![图片[1]-linux/centos/debian/ubuntu系统更换yum源,让下载速度起飞!-朝晞小屋](https://aliyun.zxiyun.com/images/2025/02/49222-linuxcentosdebianubuntu%E7%B3%BB%E7%BB%9F%E6%9B%B4%E6%8D%A2yum%E6%BA%90%EF%BC%8C%E8%AE%A9%E4%B8%8B%E8%BD%BD%E9%80%9F%E5%BA%A6%E8%B5%B7%E9%A3%9E%EF%BC%81-150B2W.png)
为大家提供三个常用镜像站:
网易镜像站的地址:http://mirrors.163.com/
CentOS镜像站地址:http://mirror.centos.org/
阿里云镜像站地址:https://developer.aliyun.com/mirror/
大家记下这两个地址,想查询一些依赖包时可去这里查询。
下面说下方法:
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
暂无评论内容