tsx81429 发表于 2024-6-13 00:09:54

Ubuntu 快速更换阿里源

转载:Ubuntu 快速更换阿里源-阿里云开发者社区 (aliyun.com)
简介: 本文紧张给各人讲解如何为Ubuntu更换阿里源,通过以下四个步骤即可快速实现换源。
一、查看ubuntu的Codename

lsb_release -a | grep Codename | awk '{print $2}' # 输出结果为下文中的Codename https://img-blog.csdnimg.cn/direct/40191463c39249798888ac8a3416e0f8.png 
二、备份系统源

cd /etc/apt
sudo mv sources.list sources.list.bak  三、写入阿里云的源

vi sources.list  下面源信息中$Codename为第一步中系统的Codename,用记事本批量替换即可。
deb http://mirrors.aliyun.com/ubuntu/ $Codename main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ $Codename-backports main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ $Codename-proposed main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ $Codename-security main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ $Codename-updates main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ $Codename main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ $Codename-backports main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ $Codename-proposed main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ $Codename-security main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ $Codename-updates main multiverse restricted universe 四、执行更新

执行以下下令,完成更新。
apt-get update 说明:可以通过ubuntu-dists安装包下载_开源镜像站-阿里云查看是否支持当前系统的Codename。 
 

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页: [1]
查看完整版本: Ubuntu 快速更换阿里源