![图片[1]-linux/centos/debian/ubuntu系统更换yum源,让下载速度起飞!-朝晞小屋](https://aliyun.zxiyun.com/images/2025/02/49222-linuxcentosdebianubuntu系统更换yum源,让下载速度起飞!-150B2W.png)
首先,为大家提供三个镜像站:
网易镜像站的地址:http://mirrors.163.com/
CentOS镜像站地址:http://mirror.centos.org/
阿里云镜像站地址:https://developer.aliyun.com/mirror/
无论是我们下载的yum包,还是通过yum命令下载的包,一般的话都是这两个镜像站的资源。在后面我们修改yum的配置文件时会切换到这两个镜像地址。希望大家记下这两个地址,想查询一些依赖包时可去这里查询。
下面说下方法:
1.不管下载那个都先备份:
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
阿里:
下载新的 CentOS-Base.repo 到 /etc/yum.repos.d/
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
CentOS 8
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
网易:
下载新的 CentOS-Base.repo 到 /etc/yum.repos.d/
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
CentOS 8
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS8-Base-163.repo
2.清理一下旧包 yum clean all
3.生成缓存即可用新源了 yum makecache
4.下载文件的存放位置 默认是: /var/cache/yum



















![战神引擎传奇手游【1.76青龙复古[白猪3.1]】2025整理特色服务端+情怀复古+复刻三端【站长亲测】-朝晞小屋](https://aliyun.zxiyun.com/images/2025/11/64541-战神引擎传奇手游【1-76青龙复古白猪3-1】2025整理特色-7K8Zyh-800x450.jpg)


暂无评论内容