安裝Ubuntu後,使用國外源太慢了,修改爲國內源會快很多。
1、修改過程
1.1 備份
備份/etc/apt/sources.list,命令如下:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
1.2 修改Ubuntu的源列表
修改 /etc/apt/sources.list
文件下的列表,特別需要說明的是這些列表和當前的Ubuntu系統的版本有關,不同版本使用不同的配置。例如:
1.2.1 官方中國 Ubuntu 18.04 更新源
deb http://cn.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
1.2.2 官方中國 Ubuntu 16.04 更新源
deb http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
##測試版源
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-proposed main restricted universe multiverse
# 源碼
deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
##測試版源
deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-proposed main restricted universe multiverse
# Canonical 合作伙伴和附加
deb http://archive.canonical.com/ubuntu/ xenial partner
deb http://extras.ubuntu.com/ubuntu/ xenial main
1.3 最後執行更新源命令
更新源命令如下:
sudo apt-get update
sudo apt-get upgrade
2、國內比較有名的Ubuntu鏡像網站
可將官方中國 http://cn.archive.ubuntu.com/ubuntu/ 替換爲下面任意的服務器:
- 阿里雲
http://mirrors.aliyun.com/ubuntu/
Ubuntu 18.04 更新源如下:
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
- 網易
http://mirrors.163.com/ubuntu/
Ubuntu 18.04 更新源如下:
deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
教育網
-
中科大
https://mirrors.ustc.edu.cn/ubuntu/ (v4/v6)
http://mirrors4.ustc.edu.cn/ubuntu/ (v4)
http://mirrors6.ustc.edu.cn/ubuntu/ (v6) -
中科院 OpenCAS
http://mirrors.opencas.cn/ubuntu/ -
清華
http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ (v4/v6) http://mirrors.4.tuna.tsinghua.edu.cn/ubuntu/ (v4) http://mirrors.6.tuna.tsinghua.edu.cn/ubuntu/ (v6) -
上海交通大學
http://ftp.sjtu.edu.cn/ubuntu/ (v4/v6)
http://ftp6.sjtu.edu.cn/ubuntu/ (v6)
3、參考資料
-
Ubuntu 16.04 source
http://wiki.ubuntu.org.cn/模板:16.04source -
Ubuntu 18.04修改默認源爲國內源
https://www.linuxidc.com/Linux/2018-08/153709.htm