1. 程式人生 > >【Ubuntu】Ubuntu系統更換軟體更新源

【Ubuntu】Ubuntu系統更換軟體更新源

    我們使用ubuntu需要經常地使用命令update upgrade來更新軟體列表和升級系統,但ubuntu預設的更新源太慢了,我們可以通過更換國內的軟體源來加快系統的更新。

1.ubuntu下的源列表為/etc/apt/sources.list,在更換前先備份一下以備不時之需:

cp   /etc/apt/sources.list   /etc/apt/sources.list.backup

2.接著用gedit或vim開啟源列表進行修改:

sudo   gedit   /etc/apt/sources.list

比如我要使用清華大學的軟體源,將源連結覆蓋寫入source.list:

# 預設註釋了原始碼映象以提高 apt update 速度,如有需要可自行取消註釋
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse

# 預釋出軟體源,不建議啟用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse


如果使用其他版本的系統,可以在清華大學開源軟體映象站中尋找對應的源:

3.儲存檔案,進行更新。

sudo apt-get update

sudo apt-get upgrade