<span>Centos7+配置阿里云yum源</span>

备份

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

 

下载新的 CentOS-Base.repo 到 /etc/yum.repos.d/

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

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

# centos6 系统更新源方式
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

# centos8 系统更新源方式
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo

 

生成缓存,更新yum源

yum clean all
yum makecache
yum -y update

 

非阿里云ECS用户

可能会出现 Couldn't resolve host 'mirrors.cloud.aliyuncs.com' 信息,不影响使用。可自行修改相关配置

sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
全部评论

相关推荐

牛客48826091...:哥们胸肌挺好看
点赞 评论 收藏
分享
10-20 16:50
门头沟学院 Java
牛客68421677...:同是天涯沦落人啊,我也是26届0实习,不知道怎么办了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务