第一种:(通过命令行进行更改)
# 先备份原有软件源
sudo cp /etc/apt/sourcre.list /etc/apt/sourcre.list.bak
# 打开配置文件
vim /etc/apt/sourcre.list
# 覆盖原有的软件源 复制下面内容 为Ubuntu16.04
# 默认注释了源码镜像以提高 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
# 命令更新源
sudo apt-get update && sudo apt-get upgrade
第二种:(Ubuntu图形界面设置)
- 点击system settings
- 点击software & updates
- 在Ubuntu Software栏中,找到Download from下拉选项,选择Other,在里面找到China,这个国家,里面的源都可使用
- 最后先点击Select Best Server,再点击Choose Server,之后再终端窗口使用sudo apt-get update进行验证就可