ubuntu切換源 助記

2021-09-10 23:58:40 字數 2813 閱讀 7241

1. 備份原始檔案

sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
2. 修改檔案並新增國內源

vi /etc/apt/sources.list
3. 注釋原檔案內的源並新增如下位址

#ubuntu 官方源 

deb gutsy main restricted universe multiverse

deb gutsy-security main restricted universe multiverse

deb gutsy-updates main restricted universe multiverse

deb gutsy-proposed main restricted universe multiverse

deb gutsy-backports main restricted universe multiverse

deb-src gutsy main restricted universe multiverse

deb-src gutsy-security main restricted universe multiverse

deb-src gutsy-updates main restricted universe multiverse

deb-src gutsy-proposed main restricted universe multiverse

deb-src gutsy-backports main restricted universe multiverse

#或者這些源

#阿里雲

deb bionic main restricted universe multiverse

deb bionic-security main restricted universe multiverse

deb bionic-updates main restricted universe multiverse

deb bionic-proposed main restricted universe multiverse

deb bionic-backports main restricted universe multiverse

deb-src bionic main restricted universe multiverse

deb-src bionic-security main restricted universe multiverse

deb-src bionic-updates main restricted universe multiverse

deb-src bionic-proposed main restricted universe multiverse

deb-src bionic-backports main restricted universe multiverse#網易163

deb trusty main restricted universe multiverse

deb trusty-security main restricted universe multiverse

deb trusty-updates main restricted universe multiverse

deb trusty-proposed main restricted universe multiverse

deb trusty-backports main restricted universe multiverse

deb-src trusty main restricted universe multiverse

deb-src trusty-security main restricted universe multiverse

deb-src trusty-updates main restricted universe multiverse

deb-src trusty-proposed main restricted universe multiverse

deb-src trusty-backports main restricted universe multiverse

4. 放置非官方源的包不完整,可在為不新增官方源

deb  feisty main restricted universe multiverse
5. 更新源

sudo apt-get update
6. 更新軟體

sudo apt-get dist-upgrade

sudo apt-get upgrade

由於包與包之間存在各種依賴關係。upgrade只是簡單的更新包,不管這些依賴,它不和新增包,或是刪除包。而dist-upgrade可以根據依賴關係的變化,新增包,刪除包。upgrade:系統將現有的package公升級,如果有相依性的問題,而此相依性需要安裝其它新的package或影響到其它package的相依性時,此package就不會被公升級,會保留下來. dist-upgrade:可以聰明的解決相依性的問題,如果有相依性問題,需要安裝/移除新的package,就會試著去安裝/移除它. (所以通常這個會被認為是有點風險的公升級) 

7. 常見的修復安裝命令

sudo apt-get -f install
原文 :

ubuntu映象源切換

換源準備 換源之前明確使用平台,x86架構 arm架構的源,ubuntu18.04和unbuntu16.04等源均不同,切忌病急亂投醫,看到乙個源複製過來新增後沒用。分析一條源 debubuntu bionic updates main restricted universe multiverse ...

Ubuntu16 0 4切換阿里源

如國內網路使用ubuntu 則會出現apt get無法安裝更新的問題,這時大家需要切換到一些國內第三方更新源。首先檢視自己的ubuntu系統的codename,直接導致你更新的源是否對你的系統起效果,檢視方法 lsb release a 我的系統顯示結果是 codename xenial 確認阿里源...

Ubuntu18 04切換映象源時出錯

校驗數字簽名時出錯。此倉庫未被更新,所以仍然使用此前的索引檔案。gpg 錯誤 bionic inrelease 下列簽名無效 expkeysig 8c718d3b5072e1f5 mysql release engineering mysql build oss.oracle.com e 倉庫 st...