标签:
1、删除redhat原有的yum源
rpm -aq | grep yum | xargs rpm -e --nodeps
2、下载新的yum安装包
wget http://mirror.centos.org/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm wget http://mirror.centos.org/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm wget http://mirror.centos.org/centos/6/os/x86_64/Packages/yum-3.2.29-60.el6.centos.noarch.rpm wget http://mirror.centos.org/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-30.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-16.el6.x86_64.rpm rpm -ivh yum-3.2.29-60.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-30.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 最后保存! %s/$releasever/6/g
5、清理缓存
yum clean all
6、将服务器上的软件包信息缓存在本地,以提高搜索安装软件的速度
yum makecache
7、升级已安装的包(可选)
yum update
8、参考
http://blog.itpub.net/23890223/viewspace-757724/
标签:
原文地址:http://www.cnblogs.com/Ehtan/p/4547407.html