Ubuntu 16.04下載軟件速度有點慢,由於默認的是從國外下載軟件,那就更換到國內比較好的快速更新源(就是這些軟件所在的服務器),通常直接百度Ubuntu更新源就能出來一大堆,這時候最好是找和本身Ubuntu版本一致的更新源,個人Ubuntu版本是16.04,下面是我找到的一個比較好的更新源。linux
1.尋找國內鏡像源ubuntu
https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/vim
2.配置source list源服務器
sources.list系統自帶的,源是來Ubuntu的官網!安裝包比較慢,因此最好切換成國內的測試
linuxidc.com@ubuntu:~$ cd /etc/apt
linuxidc.com@ubuntu:/etc/apt$ sudo cp sources.list sources.list.bak
linuxidc.com@ubuntu:/etc/apt$ vim sources.list ui
# 默認註釋了源碼鏡像以提升 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 multiversespa
# 預發佈軟件源,不建議啓用
# 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 multiverserest
3. 更新源blog
linuxidc.com@ubuntu:/etc/apt$ sudo apt-get update
命中:1 http://mirrors.aliyun.com/ubuntu xenial InRelease
命中:2 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease
命中:3 http://mirrors.aliyun.com/ubuntu xenial-backports InRelease
命中:4 http://mirrors.aliyun.com/ubuntu xenial-security InRelease
正在讀取軟件包列表... 完成 rem
測試:安裝sl包
linuxidc.com@ubuntu:/etc/apt$ sudo apt-get install sl
linuxidc.com@ubuntu:/etc/apt$ sl
4.其餘一些命令
sudo apt-get update 更新源sudo apt-get install package 安裝包sudo apt-get remove package 刪除包sudo apt-cache search package 搜索軟件包sudo apt-cache show package 獲取包的相關信息,如說明、大小、版本等sudo apt-get install package --reinstall 從新安裝包sudo apt-get -f install 修復安裝sudo apt-get remove package --purge 刪除包,包括配置文件等sudo apt-get build-dep package 安裝相關的編譯環境sudo apt-get upgrade 更新已安裝的包sudo apt-get dist-upgrade 升級系統sudo apt-cache depends package 瞭解使用該包依賴那些包sudo apt-cache rdepends package 查看該包被哪些包依賴sudo apt-get source package 下載該包的源代碼sudo apt-get clean && sudo apt-get autoclean 清理無用的包sudo apt-get check 檢查是否有損壞的依賴