查看有无 yum安装包 ,有的话卸载:
查看:rpm -qa |grep yum
卸载:rpm -aq|grep yum|xargs rpm -e –nodeps
第一步: 到这个网站去下载如下RPM包 :http://mirrors.163.com/centos/6/os/x86_64/Packages/
wget python-urlgrabber-3.9.1-11.el6.noarch.rpm
wget yum-3.2.29-81.el6.centos.noarch.rpm
wget yum-cron-3.2.29-81.el6.centos.noarch.rpm
wget yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
wget yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm
第二步:下载完成后安装:
rpm -ivh –force –nodeps python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm -ivh –force –nodeps yum-metadata-parser-1.1.2-14.1.el6.x86_64.rpm
rpm -ivh –force –nodeps yum-3.2.27-14.el6.centos.noarch.rpm um-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm
注意:注意最后两个包必需同时安装,否则会相互依赖
第三步:下载阿里云的yum源:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
下载以后生成缓存,命令:
yum makecache
如果有提示错误,运行下面的命令:[Errno 14] PYCURL ERROR 22 – “The requested URL returned error: 404 Not Found”
sed -i ‘s/\$releasever/6/’ CentOS-Base.repo 备注:把文件里的$releasever替换为6
最后:重新生成缓存,数字不为0,就OK了:
yum clean all
yum makecache
———————
评论(0)