ubuntu切换国内软件安装源

总所周知的原因,国内的网络在访问一些国外软件源的时候速度会比较慢,庆幸的是很多大公司都提供了软件源镜像,对于ubuntu的软件源镜像,我们只需要配置sources.list即可.

首选需要确定ubuntu的版本,这个很关键 lsb_release -c

Codename:       bionic

这个bionic就是版本号,下面修改的sources.list的时候替换成此处的版本号即可。

  1. sudo vim /etc/apt/sources.list

  2. 删除原有内容

  3. 粘贴下面内容

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-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed 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
  1. 更新
sudo apt update 
sudo apt upgrade