码迷,mamicode.com
首页 > 其他好文 > 详细

Centos更换阿里云源

时间:2019-08-06 19:48:44      阅读:289      评论:0      收藏:0      [点我收藏+]

标签:back   epo   cloud   ade   mirrors   pos   wget   update   could   

1、备份

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

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

CentOS 6

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

或者

curl -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

或者

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

3、之后生成缓存并更新系统

yum clear all
yum makecache
yum list updates
yum -y update(更新内核) 或 yum -y upgrade(不更新内核)

4、其他

非阿里云ECS用户会出现 Couldn‘t resolve host ‘mirrors.cloud.aliyuncs.com‘ 信息,不影响使用。用户也可自行修改相关配置: eg:

sed -i -e /mirrors.cloud.aliyuncs.com/d -e /mirrors.aliyuncs.com/d /etc/yum.repos.d/CentOS-Base.repo

Centos更换阿里云源

标签:back   epo   cloud   ade   mirrors   pos   wget   update   could   

原文地址:https://www.cnblogs.com/rhjeans/p/11311184.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!