Redhat 7使用CentOS 7的Yum网络源

由于redhat 的更新包只对注册的用户生效,所以需要自己手动更改成CentOS 的更新包,CentOS几乎和redhat是一样的,所以无需担心软件包是否可安装,安装之后是否有问题,另外CentOS公司去年已经被Redhat 收购了,下面是安装步骤。

1、首先查看redhat 7.0系统本身所安装的那些yum 软件包:

[[email protected] ~]# rpm -qa | grep yum
yum-utils-1.1.31-24.el7.noarch
yum-langpacks-0.4.2-3.el7.noarch
yum-metadata-parser-1.1.4-10.el7.x86_64
yum-rhn-plugin-2.0.1-4.el7.noarch
PackageKit-yum-0.8.9-11.el7.x86_64
yum-3.4.3-118.el7.noarch

2、卸载这些软件包;

[[email protected] ~]# rpm -e yum-3.4.3-118.el7.noarch --nodeps
[[email protected] ~]# rpm -e yum-utils-1.1.31-24.el7.noarch --nodeps
[[email protected] ~]# rpm -e yum-rhn-plugin-2.0.1-4.el7.noarch --nodeps
[[email protected] ~]# rpm -e yum-metadata-parser-1.1.4-10.el7.x86_64 --nodeps
[[email protected] ~]# rpm -e yum-langpacks-0.4.2-3.el7.noarch --nodeps
[[email protected] ~]# rpm -e PackageKit-yum-0.8.9-11.el7.x86_64 --nodeps

3、保证本机电脑能上网;

[[email protected] ~]# ping www.baidu.co
PING www.a.shifen.com (61.135.169.121) 56(84) bytes of data.
64 bytes from 61.135.169.121: icmp_seq=1 ttl=53 time=31.8 ms
64 bytes from 61.135.169.121: icmp_seq=2 ttl=53 time=31.9 ms
64 bytes from 61.135.169.121: icmp_seq=3 ttl=53 time=32.0 ms

4、进入以下网站上面查看软件包的版本是否升级或者找到自己系统所对应的文件包版本更新;

网易163网络源地址:http://mirrors.163.com/
CentOS网络源地址:http://centos.ustc.edu.cn/centos/

5、找到自己所需要的版本下载:

[[email protected] ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-118.el7.centos.noarch.rpm
--2016-01-17 20:43:15--  http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-118.el7.centos.noarch.rpm
Resolving mirrors.163.com (mirrors.163.com)... 123.58.173.185, 123.58.173.186
Connecting to mirrors.163.com (mirrors.163.com)|123.58.173.185|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2016-01-17 20:43:15 ERROR 404: Not Found.   //如果找不到,是安装包更新了,你可以到这个网站http://mirrors.163.com/centos/7/os/x86_64/Packages/复制下载链接,然后再下载下来;

[[email protected] ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-132.el7.centos.0.1.noarch.rpm
[[email protected] ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
[[email protected] ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-utils-1.1.31-34.el7.noarch.rpm
[[email protected] ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-updateonboot-1.1.31-34.el7.noarch.rpm
[[email protected] ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm

6、查看下载完成结果;

[[email protected] ~]# ls
yum-3.4.3-132.el7.centos.0.1.noarch.rpm
yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm
yum-updateonboot-1.1.31-34.el7.noarch.rpm
yum-utils-1.1.31-34.el7.noarch.rpm

7、安装软件包:

[[email protected] ~]# rpm -ivh yum-*
warning: yum-3.4.3-132.el7.centos.0.1.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
1:yum-metadata-parser-1.1.4-10.el7    ################################# [ 20%]
2:yum-plugin-fastestmirror-1.1.31-3   ################################# [ 40%]
3:yum-3.4.3-132.el7.centos.0.1        ################################# [ 60%]
4:yum-updateonboot-1.1.31-34.el7      ################################# [ 80%]
5:yum-utils-1.1.31-34.el7             ################################# [100%]

8、新建repo 配置文件;

[[email protected] ~]# vim /etc/yum.repos.d/CentOS-Base.repo
#CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$7 - Base - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=os
baseurl=http://mirrors.163.com/centos/7/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-$7 - Updates - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=updates
baseurl=http://mirrors.163.com/centos/7/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$7 - Extras - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=extras
baseurl=http://mirrors.163.com/centos/7/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$7 - Plus - 163.com
baseurl=http://mirrors.163.com/centos/7/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

9、至此YUM 网络源已经安装完成;

[[email protected] ~]# yum clean all

10、测试安装是否正常;

[[email protected] ~]# yum -y install lftp
Loaded plugins: fastestmirror, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package lftp.x86_64 0:4.4.8-7.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved

rpm --import http://ftp.sjtu.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
 rpm --import http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-7
 rpm --import http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6

时间: 2024-08-05 10:10:54

Redhat 7使用CentOS 7的Yum网络源的相关文章

Redhat 7.0安装CentOS 7 的Yum 网络源

redhat 的更新包只对注册的用户生效,所以我们自己手动更改成CentOS 的更新包,CentOS几乎和redhat是一样的,所以无需担心软件包是否可安装,安装之后是否有问题,另外CentOS公司去年已经被Redhat 收购了,不说费话了,我们还是来操作吧! 1.首先查看redhat 7.0系统本身所安装的那些yum 软件包: [[email protected] ~]# rpm -qa | grep yumyum-utils-1.1.31-24.el7.noarch yum-langpack

centos 安装yum网络源

安装虚拟机啊,使用公司给定的centos 6.0的iso镜像,该镜像经过裁剪,而且工作中要使用mercurial(hg)版本控制工具,所以需要yum install mercurial. 刚开始安装完该系统,yum install mercurial提示不能解析域名,应该是网络连接不上,选择桥接方式,然后在 /etc/sysconfig/network-scripts/ifcfg-eth0 该目录下配置网络,添加 BOOTPROTO=static IPADDR=192.168.30.102 NE

centos 7 配置yum本地源及yum命令使用

我们在介绍yum本地源的时候 先给大家谈谈RPM安装. RPM(Redhat Package Manager)解决源码包安装的众多依赖关系,,旨在校验安装卸载查询升级等管理软件操作. 安装:rpm -ivh filename.rpm 升级:rpm -Uvh filename.rpm 卸载:rpm -e filename.rpm 查询软件的描述信息:rpm -qpi filename 列出软件的文件信息:rpm -qpl filename.rpm 查询文件数据哪个RPM: rpm -qf file

redhat6.7 yum网络源配置

RedHat自带的yum源需要当前系统注册了RHN才可以使用,如果没有注册,当使用yum时,会提示需要注册RHN 如果没有注册RHN,则意味着我们不能使用RedHat自带的yum源.这个时候,我们可以使用CentOS系统的yum源,这里以配置网易163yum源为例. 1.首先卸载RedHat资源的yum程序 [[email protected] yum.repos.d]# rpm -qa|grep yum|xargs rpm -e --nodeps [[email protected] yum.

CentOS 7 使用 Yum 软件源安装谷歌 Chrome 浏览器

Google Chrome是一款由 Google 公司开发的网页浏览器,新版的 Chrome 浏览器使用的是 Blink 内核,具有运行速度快,稳定的特性.Chrome 能够运行在 Windows,Linux,Mac 桌面系统中,同时也能运行在手机和平板上的iOS,Android系统上,是一款跨平台的浏览器. 本文章介绍在 CentOS 7 系统上使用谷歌 Yum 软件源安装 Chrome 浏览器,谷歌的官方软件源在中国可用,使用谷歌 Yum 软件源能够保证安装的 Chrome 浏览器是最新版本

Redhat使用CentOS的Yum 网络源

Redhat 的更新包只对注册的用户生效,所以我们自己手动更改成CentOS 的更新包,CentOS几乎和redhat是一样的. 1.首先查看redhat 7.0系统本身所安装的那些yum 软件包:[[email protected] ~]# rpm -qa | grep yum yum-utils-1.1.31-24.el7.noarchyum-langpacks-0.4.2-3.el7.noarchyum-metadata-parser-1.1.4-10.el7.x86_64yum-rhn-

使用CentOS 6.9 的Yum网络源

1.查询安装的rpm包 1 rpm -qa|grep yum 2. 删除自带的 rpm包 1 rpm -qa|grep yum|xargs rpm -e --nodeps 因为一些包之间可能会有依赖关系,所以我们需要加上参数 --nodeps 无视依赖关系. 3. 下载rpm包 rpm包下载地址http://mirrors.163.com/centos/6.9/os/i386/ 在这个网站里,你可以自己选择需要下载的文件,进入形如5/或者6/的文件下载,其他的无法下载.7.0版本以后不支持i38

YUM网络源安装

YUM,Yellowdog Updater Modified基于RPM包构建的软件更新机制可以自动解决依赖关系所有软件包由集中的YUM软件仓库提供1.实验环境--------------------------[[email protected] ~]# lsb_release -a //查看当前系统版本详细信息LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd6

yum网络源配置

[[email protected] ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak[[email protected] ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo[[email protected] ~]# yum clean all[[