linux服务器配置访问外网的yum源

1 进入目录 /etc/yum.repos.d/

在这里插入图片描述

2 备份原镜像文件

mv CentOS-Base.repo CentOS-Base.repo.bak

在这里插入图片描述

3 下载新的CentOS-Base.repo

执行如下任意一条命令即可:

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

在这里插入图片描述

4 清除原有yum缓存

yum clean all

在这里插入图片描述

5 生成缓存

yum makecache

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/Keyuchen_01/article/details/122026808