使用百度雲服務器,發現百度yum源非常不穩定,果斷采用阿里源,操作步驟如下: 一、備份 $ cd /etc/yum.repos.d/ $ mv baidu-bcm.repo baidu-bcm.repo.backup $ mv CentOS-Base.repo CentOS-Base.repo.backup 二、下載新的CentOS-Base.repo 到/etc/yum.repos.d/ ##查看Centos操作系統版本,選擇對應的源 $ cat /etc/redhat-release ##CentOS 5 $ wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
##CentOS 6 $ wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
##CentOS 7 $ wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
三、運行yum makecache生成緩存 $ rm -rf /var/cache/yum $ yum clean all $ yum makecache $ yum update