【建議收藏】centos更新yum源爲阿里雲

[1] 首先備份CentOS-Base.repo

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

[2] 進入yum源配置文件目錄

cd /etc/yum.repos.d/

[3] 下載阿里雲的yum源配置文件

  • 放入/etc/yum.repos.d/(操作前請做好相應備份)

163:

wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

centos5:

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

centos6:

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

centos7:

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

[4]清理

yum clean all

[5]更新緩存

yum makecache
yum install tree -y
yum update -y
yum -y update
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章