美文网首页
centos-7更改yum阿里镜像源

centos-7更改yum阿里镜像源

作者: _icey_ | 来源:发表于2021-11-27 14:44 被阅读0次

如果centos7中没有安装wget,需要先执行
yum -y install wget
(因为这个包很小,只有2M,所以不更改镜像源的情况下也能下)

接下来输入如下命令
1、进入到yum.repos.d目录下:cd /etc/yum.repos.d
2、备份初始的CentOS-Base.repo文件:mv CentOS-Base.repo CentOS-Base.repo.bak
3、下载centos7阿里镜像源:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo?spm=a2c4e.11153940.0.0.30112d3dpM8XqF&file=Centos-7.repo
4、更新镜像:yum chean all
5、生成缓存:yum makecache

设置成功

相关文章

网友评论

      本文标题:centos-7更改yum阿里镜像源

      本文链接:https://www.haomeiwen.com/subject/bjzfxrtx.html