1. 程式人生 > >ubuntu16.4 更換更新源

ubuntu16.4 更換更新源

輸入 更換 rest ali 就是 bsp apt .html eas

貼上內容來源https://www.cnblogs.com/Alier/p/6358447.html

1 備份原來的更新源

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

如果提示權限不夠就輸入下面兩行,先進入到超級用戶,再備份
sudo -s
cp /etc/apt/sources.list /etc/apt/sources.list.backup

2 修改更新源

  打開sources.list (這就是存放更新源的文件)

sudo vim /etc/apt/sources.list

  將下面所有內容復制,粘貼並覆蓋sources.list文件中的所有內容

# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial universe
deb http:
//mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates universe deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial multiverse deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates multiverse deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted deb http:
//mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security universe deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security multiverse

3 讓更新源生效

sudo apt-get update

ubuntu16.4 更換更新源