將yum源設置為國內yum源,可以提升軟件包安裝和更新的速度,同時避免一些常見軟件版本無法找到。
國內免費提供yum源的網站有很多,如果,阿里、網易、清華、中科大等。
這里以阿里yum源為例
訪問阿里開源鏡像站:https://developer.aliyun.com/mirror
點擊“centos”,根據官網文檔,選擇對應系統版本的yum源
1、備份原來的yum源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2、下載CentOS 6的yum源
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-6.repo
3、下載epel擴展源
點擊“epel”,根據官網文檔,選擇對應系統版本的yum源
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
4、清理緩存,生成新緩存
yum clean all
yum makecache