将red hat yum 改成 centos yum

没有注册的red hat在不能yum update,为了能update,下面修改red hat的yum 源

1:删除现有yum安装的rpm

     

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

 2:下载yum安装包

cd /usr/tmp

wget http://mirrors.163.com/centos/6.4/os/x86_64/Packages/yum-3.2.29-40.el6.centos.noarch.rpm

wget http://mirrors.163.com/centos/6.4/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

wget http://mirrors.163.com/centos/6.4/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm

wget http://mirrors.163.com/centos/6.4/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm

 3:安装下载的rpm文件

rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm 
rpm -ivh yum-3.2.29-40.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm

 4:更新repo文件

mv /etc/yum.repos.d/rhel-debuginfo.repo /etc/yum.repos.d/rhel-debuginfo.repo.repo.bak

vi /etc/yum.repos.d/rhel-debuginfo.repo

 将下面的内容覆盖到rhel-debuginfo.repo中

[base]
name=CentOS-$releasever - Base
baseurl=http://mirrors.163.com/centos/6.4/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6

#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.163.com/centos/6.4/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6


[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirrors.163.com/centos/6.4/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://mirrors.163.com/centos/6.4/centosplus/$basearch/
gpgcheck=1
enabled=0

 5:清理

yum clean all

 6:测试

yum install vim

相关推荐