当前位置: 技术问答>linux和unix
如何在CentOS下升级系统? yum update命令 自己配置更新源
来源: 互联网 发布时间:2016-06-18
本文导语: 我在CentOS系统下用yum update命令不能更新,提示: Cannot retrieve repository metadata (repomd.xml) for repository: update. Please verify its path and try again 这个错误。在网上查了下需要自己配置更新源,请问如何配置?越详细...
我在CentOS系统下用yum update命令不能更新,提示: Cannot retrieve repository metadata (repomd.xml) for repository: update. Please verify its path and try again 这个错误。在网上查了下需要自己配置更新源,请问如何配置?越详细越好,(本人菜鸟),附带更新源.谢谢.
|
主要就是修改/etc/yum.repos.d/CentOS-Base.repo这个文件,
把这一段复制过去,保存。
参考一下这篇文章吧:
http://blog.chinaunix.net/u/19538/showart_1420645.html
说的很清楚
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
baseurl=http://centos.candishosting.com.cn/$releasever/os/$basearch/
http://mirrors.ta139.com/centos/$releasever/os/$basearch/
http://mirror.be10.com/centos/$releasever/os/$basearch/
http://ftp.sjtu.edu.cn/centos/$releasever/os/$basearch/
http://ftp.hostrino.com/pub/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
baseurl=http://centos.candishosting.com.cn/$releasever/updates/$basearch/
http://mirrors.ta139.com/centos/$releasever/updates/$basearch/
http://mirror.be10.com/centos/$releasever/updates/$basearch/
http://ftp.sjtu.edu.cn/centos/$releasever/updates/$basearch/
http://ftp.hostrino.com/pub/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
baseurl=http://centos.candishosting.com.cn/$releasever/addons/$basearch/
http://mirrors.ta139.com/centos/$releasever/addons/$basearch/
http://mirror.be10.com/centos/$releasever/addons/$basearch/
http://ftp.sjtu.edu.cn/centos/$releasever/addons/$basearch/
http://ftp.hostrino.com/pub/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
baseurl=http://centos.candishosting.com.cn/$releasever/extras/$basearch/
http://mirrors.ta139.com/centos/$releasever/extras/$basearch/
http://mirror.be10.com/centos/$releasever/extras/$basearch/
http://ftp.sjtu.edu.cn/centos/$releasever/extras/$basearch/
http://ftp.hostrino.com/pub/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
baseurl=http://centos.candishosting.com.cn/$releasever/centosplus/$basearch/
http://mirrors.ta139.com/centos/$releasever/centosplus/$basearch/
http://mirror.be10.com/centos/$releasever/centosplus/$basearch/
http://ftp.sjtu.edu.cn/centos/$releasever/centosplus/$basearch/
http://ftp.hostrino.com/pub/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
baseurl=http://centos.candishosting.com.cn/$releasever/contrib/$basearch/
http://mirrors.ta139.com/centos/$releasever/contrib/$basearch/
http://mirror.be10.com/centos/$releasever/contrib/$basearch/
http://ftp.sjtu.edu.cn/centos/$releasever/contrib/$basearch/
http://ftp.hostrino.com/pub/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
把这一段复制过去,保存。
参考一下这篇文章吧:
http://blog.chinaunix.net/u/19538/showart_1420645.html
说的很清楚