注意,這篇文章其實(shí)不是簡單的教你怎么換成20.04的源,而是教你一種基于20.04的方法來換源。
筆者在寫這篇文章的時(shí)候,20.04 還沒有release出來正式版,但是已經(jīng)可以在倉庫里看到有源存在了,故寫下這篇文章。
請注意:Ubuntu 20.04 已于4月23日發(fā)布正式版本。
請注意:發(fā)現(xiàn)有些軟件比如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(幸運(yùn)的考拉)
10.04(LTS)Lucid Lynx(清醒的猞猁)
10.10Oneiric Ocelot(夢幻的豹貓)
11.04Natty Narwhal(敏捷的獨(dú)角鯨)
11.10Oneiric Ocelot(有夢的虎貓)
12.04(LTS)Precise Pangolin(精準(zhǔn)的穿山甲)
12.10Quantal Quetzal(量子的綠咬鵑)
13.04Raring Ringtail(鉚足了勁的貓熊)
13.10Saucy Salamander(活潑的蠑螈)
14.04(LTS)Trusty Tahr (可靠的塔爾羊)(LTS)
14.10Utopic Unicorn(烏托邦獨(dú)角獸)
15.04Vivid Vervet (活潑的小猴)
15.10Wily Werewolf (狡猾的狼人)
16.04(LTS)Xenial Xerus (好客的非洲地松鼠)
16.10Yakkety Yak(牦牛)
17.04Zesty Zapus(開心的跳鼠)
17.10Artful Aardvark(機(jī)靈的土豚)
18.04(LTS)Bionic Beaver(仿生海貍)
18.10Cosmic Cuttlefish(宇宙墨魚)
19.04Disco Dingo(舞動(dòng)的靈犬)
19.10Eoan Ermine(白貂)
20.04(LTS)Focal Fossa(專注的馬達(dá)加斯加長尾貍貓)
…
要知道當(dāng)前系統(tǒng)的代號,可以用以下命令:
3 到阿里源看下這個(gè)源存在不存在
http://archive.ubuntu.com/ubuntu/dists/
可以看到,現(xiàn)在已經(jīng)有了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
到此這篇關(guān)于Ubuntu 20.04換阿里源的方法的文章就介紹到這了,更多相關(guān)Ubuntu 20.04換阿里源內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!