ubuntu 把軟體源修改為國內源和更新

2021-09-27 06:47:23 字數 2723 閱讀 9885

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 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

#網易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 把軟體源修改為國內源

備份原始檔案 sudo cp etc apt sources.list etc apt sources.list.backup 修改檔案並新增國內源 vi etc apt sources.list 注釋元檔案內的源並新增如下位址 阿里雲 deb trusty main restricted univ...

Ubuntu把軟體源修改為國內源和更新

1.備份原始檔案 2.sudo su獲得超級管理員許可權 3.開啟配置檔案 vi etc apt sources.list 4.在原始檔開始新增如下位址並儲存退出 新增阿里源 deb bionic security main restricted universe multiverse deb bi...

openwrt如何修改為國內軟體源

1.securecrt或putty 連線openwrt路由器並執行opkg update更新列表報錯 2.luci介面執行同樣如此 3.因此我們將預設源修改為第三方源,securecrt或putty登入路由器 執行 cp etc opkg distfeeds.conf etc opkg distfe...