ubuntu 如何更换适合自己版本的镜像源

0、get Codename

root@ubuntu:/home/lishulong# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 17.10
Release:    17.10
Codename:   artful
root@ubuntu:/home/lishulong# 
  1. 根据命令 lsb_release -a 查看 codename
  2. 将下面阿里或者清华的codename替换成自己的
  3. sudo vim /etc/apt/sources.list
  4. 将内容粘贴进去
  5. sudo apt-get update

我的镜像源(有的清华404 加入 阿里)

root@ubuntu:/home/lishulong# cat /etc/apt/sources.list
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ artful-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ artful main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ artful-backports main restricted universe multiverse
deb [arch=amd64] https://download.docker.com/linux/ubuntu artful stable
# deb-src [arch=amd64] https://download.docker.com/linux/ubuntu artful stable
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ artful-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ artful main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ artful-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ artful-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ artful-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ artful-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ artful main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ artful-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ artful-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ artful-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ artful-backports main restricted universe multiverse
root@ubuntu:/home/lishulong# 

1、阿里开源软件镜像站

link: ubuntu help

Codename:quantal

  deb http://mirrors.aliyun.com/ubuntu/ quantal main restricted universe multiverse
  deb http://mirrors.aliyun.com/ubuntu/ quantal-security main restricted universe multiverse
  deb http://mirrors.aliyun.com/ubuntu/ quantal-updates main restricted universe multiverse
  deb http://mirrors.aliyun.com/ubuntu/ quantal-proposed main restricted universe multiverse
  deb http://mirrors.aliyun.com/ubuntu/ quantal-backports main restricted universe multiverse
  deb-src http://mirrors.aliyun.com/ubuntu/ quantal main restricted universe multiverse
  deb-src http://mirrors.aliyun.com/ubuntu/ quantal-security main restricted universe multiverse
  deb-src http://mirrors.aliyun.com/ubuntu/ quantal-updates main restricted universe multiverse
  deb-src http://mirrors.aliyun.com/ubuntu/ quantal-proposed main restricted universe multiverse
  deb-src http://mirrors.aliyun.com/ubuntu/ quantal-backports main restricted universe multiverse

2、 清华大学开源软件镜像站

link:/etc/apt/sources.list

Codenname :xenial

# 默认注释了源码镜像以提高 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

你可能感兴趣的:(linux)