CentOS:国内常用的yum源


工作中大多数使用CentOS系统,当我们安装完CentOS系统的时候其实yum已经配置好了。我们直接执行yum install 软件包名称 就可以安装好一个软件包。他默认使用配置好的CentOS的源。但好多人习惯都使用下面的这二个源

1、这是中科大的源

cd /etc/yum.repos.d
mv CentOS-Base.repo CentOS-Base.repo.save   //先重命名Centos自带的yum源。
wget http://mirrors.ustc.edu.cn/centos/CentOS-Base.5.mirrors.repo O /etc/yum.repos.d/CentOS-Base.repo
yum makecache

2、这是sohu的源

cd /etc/yum.repos.d
mv CentOS-Base.repo CentOS-Base.repo.save   //先重命名Centos自带的yum源。
wget http://mirrors.sohu.com/help/CentOS-Base-sohu.repo
yum makecache

PS:
有时候会出现错误,现象:
Loading "installonlyn" plugin
Existing lock /var/run/yum.pid: another copy is running. Aborting.

这是因为yum在更新, 此时是kill不掉的该进程的, 正确的解决方法是让它停止更新即可。
可以直接输入 rm -f /var/run/yum.pid
也可以/etc/init.d/yum-updatesd stop

相关内容