CentOS添加中科大、163 yum源


首先備份CentOS-Base.repo

[root@richard yum.repos.d]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

其次,下載對應版本的CentOS-Base.repo, 放入/etc/yum.repos.d/目錄

CentOS6.x

[root@richard yum.repos.d]# wget http://lug.ustc.edu.cn/wiki/_export/code/mirrors/help/centos?codeblock=2

CentOS5.x

[root@richard yum.repos.d]# wget http://lug.ustc.edu.cn/wiki/_export/code/mirrors/help/centos?codeblock=1

運行yum clean all、yum makecache生成緩存

[root@NJZYY06 yum.repos.d]# yum clean all
Loaded plugins: aliases, changelog, downloadonly, fastestmirror, kabi, presto, refresh-packagekit, security, tmprepo, verify,
              : versionlock
Loading support for CentOS kernel ABI
Cleaning repos: base extras updates
Cleaning up Everything
Cleaning up list of fastest mirrors
11 delta-package files removed, by presto
[root@richard yum.repos.d]# yum makecache Loaded plugins: aliases, changelog, downloadonly, fastestmirror, kabi, presto, refresh-packagekit, security, tmprepo, verify, : versionlock Loading support for CentOS kernel ABI base | 9.4 kB 00:00 http://mirrors.ustc.edu.cn/centos/6/os/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file Trying other mirror. Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again [root@njzyy07 yum.repos.d]# yum makecache Loaded plugins: aliases, changelog, downloadonly, fastestmirror, kabi, presto, refresh-packagekit, security, tmprepo, verify, : versionlock Loading support for CentOS kernel ABI Loading mirror speeds from cached hostfile base | 3.7 kB 00:00 base/group_gz | 220 kB 00:00 base/filelists_db | 5.9 MB 00:20 base/primary_db | 4.4 MB 00:00 base/other_db | 2.8 MB 00:13 extras | 3.4 kB 00:00 extras/filelists_db | 11 kB 00:00 extras/prestodelta | 907 B 00:00 extras/primary_db | 19 kB 00:00 extras/other_db | 5.8 kB 00:00 updates | 3.4 kB 00:00 updates/filelists_db | 2.2 MB 00:06 updates/prestodelta | 343 kB 00:01 updates/primary_db | 3.7 MB 00:14 updates/other_db | 31 MB 01:46 Metadata Cache Created

運行 yum update升級所有軟件包(可以不選)

[root@richard yum.repos.d]# yum update

 163網易源配置請參見163官網:http://mirrors.163.com/.help/centos.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM