1、將原始的source list複製替換
-
sudo cp /etc/apt/sources.list /etc/apt/sources.list.old
2、使用vim打開source list
sudo vim /etc/apt/sources.list
3、將source list中的內容刪除,輸入ggdG,然後 摁 i 開始文本輸入,去清華鏡像源找到對應的ubuntu系統的鏡像源,將下面的內容粘貼進去即可。
#ubuntu 16.04LTS 鏡像
# 默認註釋了源碼鏡像以提高 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
*可以使用以下代碼查看ubuntu版本
cat /etc/issuse