sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
vim /etc/apt/sources.list
3.将源文件内容全部注释,添加以下内容(更换中科大源):
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb [arch=x86_64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu xenial stable
# deb-src [arch=x86_64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu xenial stable
deb [arch=x86_64] https://download.docker.com/linux/ubuntu xenial stable
# deb-src [arch=x86_64] https://download.docker.com/linux/ubuntu xenial stable
deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable
# deb-src [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable
deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/ xenial stable
# deb-src [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/ xenial stable
4.保存:Esc+:wq!
5.更新源
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get upgrade