CentOS7系统下网络yum源配置

版权声明:转载请注明出处! https://blog.csdn.net/ywd1992/article/details/89140759

1、检查网络

配置网络yum源,首先检查系统的外网是否能正常访问
在这里插入图片描述

2、获取repo文件

这里我们以网易的yum源为例,首先我们需要下载网易yum源的repo文件,这里需要注意的是,如果系统是最小化安装没有wget命令的话需要首先安装wget

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

在这里插入图片描述
列举几个国内的源地址

阿里云
http://mirrors.aliyun.com/repo/Centos-7.repo
网易
http://mirrors.163.com/.help/CentOS7-Base-163.repo

3、备份并替换系统repo文件

cd /etc/yum.repos.d/

在这里插入图片描述
备份原有CentOS-Base.repo文件,并拷贝新的文件进去

mv CentOS-Base.repo CentOS-Base.repo.bak
mv /root/CentOS7-Base-163.repo CentOS-Base.repo

在这里插入图片描述

4、更新yum源

yum clean all
yum makecache

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/ywd1992/article/details/89140759