新装redhat6添加163更新源

1.删除redhat自带yum包

[root@redhat-pro-lege ~]#rpm -aq | grep yum |xargs rpm -e --nodeps

2.下载rpm安装包

[root@redhat-pro-lege ~]#wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-60.el6.centos.noarch.rpm
[root@redhat-pro-lege ~]#wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
[root@redhat-pro-lege ~]#wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
[root@redhat-pro-lege ~]#wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm

3.安装rpm包,注意最后两个包一定要一起装

[root@redhat-pro-lege ~]#rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
[root@redhat-pro-lege ~]#rpm -ivh yum-metadata-parser-1.1.2-16.1.el6.i686.rpm
[root@redhat-pro-lege ~]#rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm 
[root@redhat-pro-lege ~]#rpm -ivh yum-3.2.29-60.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm

4.下载163的源:切换到/etc/yum.repos.d/

[root@redhat-pro-lege yum.repos.d]#wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
[root@redhat-pro-lege yum.repos.d]#cp CentOS6-Base-163.repo rhel.repo
[root@redhat-pro-lege yum.repos.d]#mv CentOS6-Base-163.repo CentOS6-Base-163.repo.bak
[root@redhat-pro-lege yum.repos.d]#sed -i 's/\$releasever/6/g' rhel.repo

5.清理一下yum缓存

[root@redhat-pro-lege ~]#yum clean all
[root@redhat-pro-lege ~]#yum makecache

6.更新一下系统即可:

[root@redhat-pro-lege ~]#yum update
[root@redhat-pro-lege ~]#yum upgrade

转载请注明来源,谢谢!!lege is here

你可能感兴趣的:(redhat)