欢迎光临
我们一直在努力

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 

赞(0) 打赏
未经允许不得转载:九八云安全 » CentOS,Ubuntu,Debian更换依赖源具体方法

评论 抢沙发