第一种:(通过命令行进行更改)

  1. # 先备份原有软件源
  2. sudo cp /etc/apt/sourcre.list /etc/apt/sourcre.list.bak
  3. # 打开配置文件
  4. vim /etc/apt/sourcre.list
  5. # 覆盖原有的软件源 复制下面内容 为Ubuntu16.04
  6. # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
  7. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
  8. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
  9. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
  10. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
  11. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
  12. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
  13. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
  14. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
  15. # 预发布软件源,不建议启用
  16. # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
  17. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
  18. # 命令更新源
  19. 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进行验证就可