概述
APT(Advanced Packaging Tool) 是 Debian/Ubuntu 类 Linux 系统中的软件包管理程序, 使用它可以找到想要的软件包, 而且安装、卸载、更新都很简便;也可以用来对 Ubuntu 进行升级; APT 的源文件为 /etc/apt/
目录下的 sources.list
文件。
修改数据源
由于国内的网络环境问题,我们需要将 Ubuntu 的数据源修改为国内数据源,操作步骤如下:
查看系统版本
lsb_release -a
# 输出如下
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
注意: Codename 为
bionic
,该名称为我们 Ubuntu 系统的名称,修改数据源需要用到该名称
编辑数据源
vi /etc/apt/sources.list
删除全部内容并修改为
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-securit