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://idc.net/help/21024/
文章版权归作者所有,未经允许请勿转载。
THE END
