ubuntu 16.04 和 18.04 替换apt源为阿里源

ubuntu 16.04 和 18.04 替换apt源为阿里源

  • ubuntu 16.04 替换apt源为阿里源
    • 备份原配置文件
    • 配置sources.list 文件
    • 刷新源
  • ubuntu 18.04 替换apt源为阿里源
    • 备份原配置文件
    • 配置sources.list 文件
    • 刷新源

ubuntu 16.04 替换apt源为阿里源

备份原配置文件

sudo  cp /etc/apt/sources.list /etc/apt/sources.list_bk

配置sources.list 文件

sudo vim /etc/apt/sources.list

将原内容删除:1000 dd ,删除一下1000行,其实用不了1000…
将下面内容贴入sources.list中

deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse

刷新源

sudo apt-get update

ubuntu 18.04 替换apt源为阿里源

备份原配置文件

sudo  cp /etc/apt/sources.list /etc/apt/sources.list_bk

配置sources.list 文件

sudo vim /etc/apt/sources.list

将原内容删除:1000 dd
将下面内容贴入sources.list中

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

刷新源

sudo apt-get update

你可能感兴趣的:(操作系统,apt-get源,ubuntu,18.04)