第一步:备份原有的repo文件,养成良好的习惯
mv rhel-source.repo rhel-source.repo.bak
第二步:下载最新的CentOS-Base.repo到/etc/yum.repos.d
wget -O /etc/yum.repos.d/CentOS-Base.repo
http://mirrors.aliyun.com/repo/Centos-6.repo
第三步:替换$releasever为6
vi /etc/yum.repos.d/CentOS-Base.repo
采用全局替换,在命令模式下输入 :%s/$releasever/6
第四步:生成缓存
yum clean all
yum makecache
注意:会出现如下的提示:Loaded plugins: product-id, refresh-packagekit,
security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
redhat中的yum会检查当前是否是得到授权的,采用CentOS源的话,不影响后面
软件的安装,也可以完全卸载redhat的yum,采用CentOS的yum软件,就不会每次
弹出该消息
第五步:测试升级python-urlgrabber
当前版本:
[[email protected] yum.repos.d]# rpm -qa |grep python-urlgrabber
python-urlgrabber-3.9.1-8.el6.noarch
升级命令:
[[email protected] yum.repos.d]# yum update python-urlgrabber
升级之后:
[[email protected] yum.repos.d]# rpm -qa |grep python-urlgrabber
python-urlgrabber-3.9.1-11.el6.noarch
注意:
当出现如下提示的时候:
http://mirrors.aliyun.com/centos/6Server/os/i386/repodata/repomd.xml: [Errno 14]
PYCURL ERROR 22 - "The requested URL returned error: 404"
Trying other mirror.
请确保
baseurl=http://mirrors.aliyun.com/centos/6/os/$basearch/
http://mirrors.aliyuncs.com/centos/6/os/$basearch/