CentOS,Ubuntu,Debian更换依赖源具体方法

因为在线安装需要在服务器上下载需要软件和依赖关系文件,所以下载的速度很影响使用体验。一般来说,Linux默认的源安装和更新速度很慢,所以安装好系统一般会选择换源,本篇文章重点为大家讲解一下CentOS,Ubuntu,Debian更换依赖源具体方法。

CentOS 7 yum源

rm -rf /etc/yum.repos.d/*.repo #删除repo文件,或者自己备份
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum makecache #更新缓存

CentOS 6 yum源

rm -rf /etc/yum.repos.d/*.repo #删除repo文件,或者自己备份
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
curl -o/etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
yum makecache #更新缓存

Ubuntu 18 apt源

mv /etc/apt/sources.list{,bak} #备份sources.list
cat > /etc/apt/sources.list 

Ubuntu 16 apt源

mv /etc/apt/sources.list{,bak} #备份sources.list
cat > /etc/apt/sources.list 

Debian 9 apt源

mv /etc/apt/sources.list{,bak} #备份sources.list
cat > /etc/apt/sources.list 

Debian 8 apt源

mv /etc/apt/sources.list{,bak} #备份sources.list
cat > /etc/apt/sources.list 

原创文章,作者:晴川运维,如若转载,请注明出处:https://baike.qcidc.com/3687.html

(0)
晴川运维晴川运维
上一篇 2025年6月4日
下一篇 2025年6月4日

相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注