centos 修改成阿里云镜方法

1.备份本地系统自带yum源配置文件

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

2.下载阿里yum源配置文件并代替/etc/yum.repos.d/默认的yum源配置文件

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

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

3.生成cache缓存

yum makecache

阿里云-推广AD
4.更新yum为最新版本

yum -y update

5.最后你可能还需要同时更新使用阿里epel源

mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup

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

yum clean all && yum makecache

本站部分文章、资源来自互联网,版权归原作者及网站所有,如果侵犯了您的权利,请及时联系我站删除。邮箱:1103606138#qq.com

站点地图