新闻动态
新闻动态
NEWS INFORMATION

Ubuntu 20.04换阿里源的方法

发布日期:2022-02-04 12:25 | 文章来源:gibhub

注意,这篇文章其实不是简单的教你怎么换成20.04的源,而是教你一种基于20.04的方法来换源。
笔者在写这篇文章的时候,20.04 还没有release出来正式版,但是已经可以在仓库里看到有源存在了,故写下这篇文章。

请注意:Ubuntu 20.04 已于4月23日发布正式版本。
请注意:发现有些软件比如ckermit,仓库里还没有,升级及换源自行斟酌。

1 备份原来的源

cp -ra /etc/apt/sources.list /etc/apt/sources.list.bak

2 搞清楚ubuntu的代号,比如:

4.10Warty Warthog(长疣的疣猪)
5.04Hoary Hedgehog(灰白的刺猬)
5.10Breezy Badger(活泼的獾)

6.06(LTS)Dapper Drake(整洁的公鸭)
6.10Edgy Eft(急躁的水蜥)
7.04Feisty Fawn(坏脾气的小鹿)
7.10Gutsy Gibbon(勇敢的长臂猿)

8.04(LTS)Hardy Heron(耐寒的苍鹭)
8.10Intrepid Ibex (勇敢的野山羊)
9.04Jaunty Jackalope(得意洋洋的怀俄明野兔)
9.10Karmic Koala(幸运的考拉)

10.04(LTS)Lucid Lynx(清醒的猞猁)
10.10Oneiric Ocelot(梦幻的豹猫)
11.04Natty Narwhal(敏捷的独角鲸)
11.10Oneiric Ocelot(有梦的虎猫)

12.04(LTS)Precise Pangolin(精准的穿山甲)
12.10Quantal Quetzal(量子的绿咬鹃)
13.04Raring Ringtail(铆足了劲的猫熊)
13.10Saucy Salamander(活泼的蝾螈)

14.04(LTS)Trusty Tahr (可靠的塔尔羊)(LTS)
14.10Utopic Unicorn(乌托邦独角兽)
15.04Vivid Vervet (活泼的小猴)
15.10Wily Werewolf (狡猾的狼人)

16.04(LTS)Xenial Xerus (好客的非洲地松鼠)
16.10Yakkety Yak(牦牛)
17.04Zesty Zapus(开心的跳鼠)
17.10Artful Aardvark(机灵的土豚)

18.04(LTS)Bionic Beaver(仿生海狸)
18.10Cosmic Cuttlefish(宇宙墨鱼)
19.04Disco Dingo(舞动的灵犬)
19.10Eoan Ermine(白貂)

20.04(LTS)Focal Fossa(专注的马达加斯加长尾狸猫)

要知道当前系统的代号,可以用以下命令:

lsb_release -a

3 到阿里源看下这个源存在不存在

http://archive.ubuntu.com/ubuntu/dists/


可以看到,现在已经有了ubuntu 20.04(代号focal)的源。

4 然后以下面的为模板,把'TODO'的地方换成上面的Codename

deb http://mirrors.aliyun.com/ubuntu/ TODO main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ TODO main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ TODO-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ TODO-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ TODO-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ TODO-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ TODO-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ TODO-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ TODO-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ TODO-backports main restricted universe multiverse

比如我换好20.04的源以后是这样:

deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

然后粘贴到刚才的/etc/apt/sources.list里。

5 更新缓存和升级

sudo apt-get update
sudo apt-get upgrade

到此这篇关于Ubuntu 20.04换阿里源的方法的文章就介绍到这了,更多相关Ubuntu 20.04换阿里源内容请搜索本站以前的文章或继续浏览下面的相关文章希望大家以后多多支持本站!

香港快速服务器

版权声明:本站文章来源标注为YINGSOO的内容版权均为本站所有,欢迎引用、转载,请保持原文完整并注明来源及原文链接。禁止复制或仿造本网站,禁止在非www.yingsoo.com所属的服务器上建立镜像,否则将依法追究法律责任。本站部分内容来源于网友推荐、互联网收集整理而来,仅供学习参考,不代表本站立场,如有内容涉嫌侵权,请联系alex-e#qq.com处理。

实时开通

自选配置、实时开通

免备案

全球线路精选!

全天候客户服务

7x24全年不间断在线

专属顾问服务

1对1客户咨询顾问

在线
客服

在线客服:7*24小时在线

客服
热线

400-630-3752
7*24小时客服服务热线

关注
微信

关注官方微信
顶部