介绍一个国内最快的CentOS YUM源

最近在使用CentOS,苦于CentOS的自带的源更新速度太慢.于是在互联网上找到了中科大中国官方镜像网站:http://centos.ustc.edu.cn/,方便以后通过yum更新软件。
CentOS 4安装的方法:

cd /etc/yum.repos.d
mv CentOS-Base.repo  CentOS-Base.repo.save
wget http://centos.ustc.edu.cn/CentOS-Base.repo
yum update

CentOS 5安装的方法:

cd /etc/yum.repos.d
mv CentOS-Base.repo  CentOS-Base.repo.save
wget http://centos.ustc.edu.cn/CentOS-Base.repo.5
mv CentOS-Base.repo.5 CentOS-Base.repo

yum update

CenOS 6安装的方法:

这是CentOS 6的:

CentOS-Base.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-$releasever - Base - mirrors.ustc.edu.cn

baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/os/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os

gpgcheck=1

gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6


#released updates

[updates]

name=CentOS-$releasever - Updates - mirrors.ustc.edu.cn

baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/updates/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates

gpgcheck=1

gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6


#additional packages that may be useful

[extras]

name=CentOS-$releasever - Extras - mirrors.ustc.edu.cn

baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/extras/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras

gpgcheck=1

gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6


#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-$releasever - Plus - mirrors.ustc.edu.cn

baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/centosplus/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus

gpgcheck=1

enabled=0

gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6


#contrib - packages by Centos Users

[contrib]

name=CentOS-$releasever - Contrib - mirrors.ustc.edu.cn

baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/contrib/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib

gpgcheck=1

enabled=0

gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6


运行yum makecache生成缓存


这样配置完以后,就可以方便地使用yum安装软件了.

PS:如果在配置YUM源后,第一次运行yum update命令,出现如下错误。

warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID*****

这是由于yum安装了旧版本的GPG keys造成的,解决办法就是

rpm –import  /etc/pki/rpm-gpg/RPM-GPG-KEY*


https://lug.ustc.edu.cn/wiki/mirrors/help

开源镜像使用帮助列表

Archlinux镜像使用帮助
Backtrack镜像使用帮助
Centos镜像使用帮助
CPAN镜像使用帮助
CRAN镜像使用帮助
CTAN镜像使用帮助
Debian镜像使用帮助
Debian Backports镜像使用帮助
Debian Security镜像使用帮助
Debian Multimedia镜像使用帮助
Dotdeb镜像使用帮助
Eclipse镜像使用帮助
EPEL镜像使用帮助
Fedora镜像使用帮助
FreeBSD镜像使用帮助
Gentoo镜像使用帮助
gentoo-portage镜像使用帮助
kdemod镜像使用帮助
Linux Mint镜像使用帮助
Opensuse镜像使用帮助
Raspbian镜像使用帮助
Scientific Linux镜像使用帮助
Slackware镜像使用帮助
Ubuntu镜像使用帮助
UKSM Kernel镜像使用帮助