RedHat 6.0使用CentOS YUM源更新的方法

由于Redhat的yum在线更新是收费的,如果没有注册的话是不能使用的,即不能在线安装软件。在这种情况下,想使用Redhat系统,还想用yum源来在线安装软件,有没有办法?

  答案是有办法,请往下看!

1、删除redhat原有的yum源

# rpm -aq | grep yum|xargs rpm -e --nodeps

2、下载新的yum安装包 

  这里我们使用CentOS的yum源

# wget http://mirror.centos.org/centos/6.0/os/i386/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm

# wget http://mirror.centos.org/centos/6.0/os/i386/Packages/yum-metadata-parser-1.1.2-14.1.el6.i686.rpm

# wget http://mirror.centos.org/centos/6.0/os/i386/Packages/yum-3.2.27-14.el6.centos.noarch.rpm

# wget http://mirror.centos.org/centos/6.0/os/i386/Packages/yum-plugin-fastestmirror-1.1.26-1.el6.noarch.rpm

3、安装yum软件包

# rpm -ivh  python-iniparse-0.3.1-2.1.el6.noarch.rpm

# rpm -ivh  yum-metadata-parser-1.1.2-14.1.el6.i686.rpm

# rpm -ivh  yum-3.2.27-14.el6.centos.noarch.rpm  yum-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm

  注意:最后两个安装包要放在一起同时安装,否则会提示相互依赖,安装失败。

4、更改yum源  #我们使用网易的CentOS镜像源

# cd /etc/yum.repos.d/

# wget  http://mirrors.163.com/.help/CentOS6-Base-163.repo

# vi CentOS6-Base-163.repo

  编辑文件,把文件里面的$releasever全部替换为版本号,即6 最后保存!或者直接把下面的内存拷贝到CentOS6-Base-163.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-6 - Base - 163.com

baseurl=http://mirrors.163.com/centos/6/os/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=os

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#released updates

[updates]

name=CentOS-6 - Updates - 163.com

baseurl=http://mirrors.163.com/centos/6/updates/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=updates

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful

[extras]

name=CentOS-6 - Extras - 163.com

baseurl=http://mirrors.163.com/centos/6/extras/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=extras

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-6 - Plus - 163.com

baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=centosplus

gpgcheck=1

enabled=0

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users

[contrib]

name=CentOS-6 - Contrib - 163.com

baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=contrib

gpgcheck=1

enabled=0

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#########################################################################

5、清理yum缓存

# yum clean all

# yum makecache     #将服务器上的软件包信息缓存到本地,以提高搜索安装软件的速度

# yum install vim*    #测试域名是否可用

  至此,Redhat6可以使用CentOS的yum源在线安装软件了!

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • redhat6.5.安装后,登录系统,使用yum update 更新系统。提示:This system is no...
    个人精进成长营阅读 3,935评论 0 0
  • 一般安装好redhat后,不能注册的话,不能使用系统自带的yum源。但是我们可以自己配置yum源来解决这一问题。下...
    田旭1阅读 4,093评论 0 0
  • 1从http://rpm.pbone.net/下载 yum-3.4.3-132.el7.centos.0.1.no...
    ghost798阅读 4,479评论 0 1
  • 昨天晚上回宾馆后, 纠结到底是报团游三亚,还是租车自驾游,报团游就是行程比较赶,不用自己做攻略,从出行到吃,到景点...
    阿广阅读 1,499评论 0 0
  • 睡过了头,纠结在梦境。 生物钟敲响,收能量时间到。因为醒不来被某某收走70g,忿忿不平去抢回17g。 然后又安心昏...
    唐四月阅读 1,517评论 0 0

友情链接更多精彩内容