apt更换阿里源

1.预备了解

版本 版本号 代号
Lucid(10.04) 10.04 lucid
Precise(12.04) 12.04 precise
Trusty(14.04) 14.04 trusty
Utopic(14.10) 14.10 utopic
Ubuntu 16.04 TLS 16.04 xenial
Ubuntu 18.04 TLS 18.04 bionic

根据目前的系统修改相应的源信息:

  deb https://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse 

2.备份修改配置文件

  sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup    //备份
  sudo vi  /etc/apt/sources.list    //操作文件
  ggdG    //删除原有信息
  // 添加源信息

3.阿里源

# https://opsx.alibaba.com/mirror
deb https://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse 
deb https://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse 
deb https://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse 
deb https://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse 
deb https://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse 

# 仿照清华镜像源,注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
# deb-src https://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse 
# deb-src https://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse 
# deb-src https://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse 
# deb-src https://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse 
# deb-src https://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容