修改数据源
由于国内的网络环境问题,我们需要将 Ubuntu 的数据源修改为国内数据源,操作步骤如下:
查看系统版本
lsb_release -a
输出结果为
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04 LTS
Release: 16.04
Codename: xenial
注意: Codename 为 xenial
,该名称为我们 Ubuntu 系统的名称,修改数据源需要用到该名称
编辑数据源
vi /etc/apt/sources.list
删除全部内容并修改为
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
更新数据源
apt-get update