歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> CentOS:國內常用的yum源

CentOS:國內常用的yum源

日期:2017/2/28 16:12:49   编辑:Linux教程

工作中大多數使用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

Copyright © Linux教程網 All Rights Reserved