pop!_OS換國內源
今天給電腦換源了,雖然本來的源大部分好像也都連的上(不知道是不是錯覺)換的這個:
先進入存放源的目錄:` cd /etc/apt
裡面有這些檔案:
sources.list是要修改的,先給它建立一個備份: ` sudo cp sources.list source.list.backup
然後` sudo vim sources.list
在最前面加上(我的電腦Codename是focal,見後文):
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/
focal main restricted universe multiversedeb 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 multiversedeb 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
再儲存並退出。
最後` sudo apt update 更新一下。
關於加上的東西是什麼意思:
-
deb是通過.deb方式安裝 deb-src是原始檔安裝
-
中間是網址
-
後面的bionic或(focal)對應阿里雲裡面的目錄
-
再後面是目錄裡面的幾個目錄
關於bionic和focal:
這個是電腦對應的Codename,我一開始弄錯了這個,把源改的bionic的
應該通過命令 ` lsb_release -a來檢視
可見我的電腦是focal的。我一開始就弄錯了這個。然後複製[這個]:(https://developer.aliyun.com/mirror/ubuntu?spm=a2c6h.13651102.0.0.6ef01b11zm76Jf)focal的。