新闻公告使用手机扫一扫查看
< 返回

Ubuntu修改APT软件源教程

2022-01-15 19:00 作者:老七云-运管001 阅读量:282

Linux拥有众多的发行版,每个发行版都有提供镜像,但是,有些镜像的下载速度参差不齐,偶尔会有更新失败的情况。

下面以修改 Ubuntu 软件源为中科大为例进行说明。

镜像地址:https://mirrors.ustc.edu.cn/

1.备份原配置文件

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

2.更改配置文件

编辑/etc/apt/sources.list文件, 将内容修改为:

Xenial(16.04)

  1. deb https://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted
  2. deb https://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted
  3. deb https://mirrors.ustc.edu.cn/ubuntu/ xenial universe
  4. deb https://mirrors.ustc.edu.cn/ubuntu/ xenial-updates universe
  5. deb https://mirrors.ustc.edu.cn/ubuntu/ xenial multiverse
  6. deb https://mirrors.ustc.edu.cn/ubuntu/ xenial-updates multiverse
  7. deb https://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
  8. deb https://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted
  9. deb https://mirrors.ustc.edu.cn/ubuntu/ xenial-security universe
  10. deb https://mirrors.ustc.edu.cn/ubuntu/ xenial-security multiverse

Trusty(14.04)

  1. deb https://mirrors.ustc.edu.cn/ubuntu/ trusty main restricted
  2. deb https://mirrors.ustc.edu.cn/ubuntu/ trusty-updates main restricted
  3. deb https://mirrors.ustc.edu.cn/ubuntu/ trusty universe
  4. deb https://mirrors.ustc.edu.cn/ubuntu/ trusty-updates universe
  5. deb https://mirrors.ustc.edu.cn/ubuntu/ trusty multiverse
  6. deb https://mirrors.ustc.edu.cn/ubuntu/ trusty-updates multiverse
  7. deb https://mirrors.ustc.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse
  8. deb https://mirrors.ustc.edu.cn/ubuntu/ trusty-security main restricted
  9. deb https://mirrors.ustc.edu.cn/ubuntu/ trusty-security universe
  10. deb https://mirrors.ustc.edu.cn/ubuntu/ trusty-security multiverse

Precise(12.04)

  1. deb https://mirrors.ustc.edu.cn/ubuntu/ precise main restricted
  2. deb https://mirrors.ustc.edu.cn/ubuntu/ precise-updates main restricted
  3. deb https://mirrors.ustc.edu.cn/ubuntu/ precise universe
  4. deb https://mirrors.ustc.edu.cn/ubuntu/ precise-updates universe
  5. deb https://mirrors.ustc.edu.cn/ubuntu/ precise multiverse
  6. deb https://mirrors.ustc.edu.cn/ubuntu/ precise-updates multiverse
  7. deb https://mirrors.ustc.edu.cn/ubuntu/ precise-backports main restricted universe multiverse
  8. deb https://mirrors.ustc.edu.cn/ubuntu/ precise-security main restricted
  9. deb https://mirrors.ustc.edu.cn/ubuntu/ precise-security universe
  10. deb https://mirrors.ustc.edu.cn/ubuntu/ precise-security multiverse

3.更新

  1. # apt-get update
  2.  
联系我们
返回顶部