赞
踩
感谢博主分享,原文链接:https://blog.csdn.net/qq_37791764/article/details/78966277
redhat默认自带的yum源需要注册,才能更新,报错:
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
http://mirrors.163.com/centos/6Server/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - “The requested URL returned error: 404 Not Found”
Trying other mirror.
可替换为centos对应的源。
CentOS6-Base-163.repo 替换后的文件内容()
- # CentOS-Base.repo
- #
- # The mirror system uses the connecting IP address of the client and the
- # update status of each mirror to pick mirrors that are updated to and
- # geographically close to the client. You should use this for CentOS updates
- # unless you are manually picking other mirrors.
- #
- # If the mirrorlist= does not work for you, as a fall back you can try the
- # remarked out baseurl= line instead.
- #
- #
-
- [base]
- name=CentOS-6 - Base - 163.com
- baseurl=http://mirrors.163.com/centos/6/os/$basearch/
- #mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=os
- gpgcheck=1
- gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
-
- #released updates
- [updates]
- name=CentOS-6 - Updates - 163.com
- baseurl=http://mirrors.163.com/centos/6/updates/$basearch/
- #mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=updates
- gpgcheck=1
- gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
-
- #additional packages that may be useful
- [extras]
- name=CentOS-6 - Extras - 163.com
- baseurl=http://mirrors.163.com/centos/6/extras/$basearch/
- #mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=extras
- gpgcheck=1
- gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
-
- #additional packages that extend functionality of existing packages
- [centosplus]
- name=CentOS-6 - Plus - 163.com
- baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/
- #mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=centosplus
- gpgcheck=1
- enabled=0
- gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
-
- #contrib - packages by Centos Users
- [contrib]
- name=CentOS-6 - Contrib - 163.com
- baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/
- #mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=contrib
- gpgcheck=1
- enabled=0
- gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
更换yum源,将原有源删除或备份到别的目下下:
- cd /etc/yum.repos.d/
- wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
- vi CentOS6-Base-163.repo 编辑文件,把文件里面的$releasever全部替换为版本号:6(注意,不是6.5!)最后保存!
- 替换命令: %s/$releasever/6/g
清除原有缓存,重建缓存:
#yum clean all
#yum makecache
更新系统(以上步骤完成后可先尝试yum是否能用, 不能用在使用该命令。 该命令执行很长时间)
#yum update
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。