Linux更换yum源

一、更换成国内的yum源

1.1 查看原有的yum源

rpm -qa | grep yum
1.2 删除原来有的yum源

rpm -aq | grep yum | xargsrpm -e -nodeps
确认:

rpm -qa | grep yum
1.3 下载新的yum安装包

wget http://mirrors.aliyun.com/centos/6/os/x86_64/Packages/yum-3.2.29-73.el6.centos.noarch.rpm
wget http://mirrors.aliyun.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
wget http://mirrors.aliyun.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
wget http://mirrors.aliyun.com/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm
这里我使用的是阿里云,也可以用163等其他

1.5 安装yum

rpm -ivh python-urlgrabber-3.9.1-11.el6.noarch.rpm
rpm –ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
* 注释:下面两个要一起安装

rpm –ivh yum-3.2.29-81.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm
* 注释:

假如最后一步安装报错,查看错误,发现pytho

你可能感兴趣的:(centos,linux,服务器)