Linux Centos7 更换 阿里 163 YUM (源)

Yum是红帽的 rpm文件管理器,默认会根据资源选择就近的镜像地址下载,默认会在本地有一个镜像地址的缓存,为了稳定下载速度,建议配置成国内的镜像地址,163,阿里云 。

1. 安装wget,//   yum install wget -y
2.进入yum配置文件目录(固定的)。//  cd /etc/yum.repo.d/

注意: 这里有 8个 文件 

 3. 目标是更换CentOS-Base.repo文件,先备份一下。
                                    //  mv CentOS-Base.repo CentOS-Base.repo.bak

 4. 通过wget 工具,选择centos的版本选择即可

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

 5.  yum的本地缓存,所以需要先清空一波本地的缓存,再用阿里云的替换掉。
           //  yum clean all

 6. 制作阿里云的缓存   // yum makecache

 这里阿里云的源就配置好了,配置 华为 163 方法一样
 

猜你喜欢

转载自blog.csdn.net/shanxun1012/article/details/130509655