Ubuntu 20.04 apt 源修改为国内的阿里云镜像源
程序员文章站
2022-06-05 17:29:43
...
查看当前系统的版本信息
命令:lsb_release -a
[email protected]:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal
切换为 root 用户
sudo - root
备份默认的源
cp /etc/apt/sources.list /etc/apt/sources.list.bak
修改为国内的阿里云镜像源
sed -i "s/archive.ubuntu.com/mirrors.aliyun.com/g" /etc/apt/sources.list
删除#开头的注释行
sed -i '/^#/d' /etc/apt/sources.list
更新 apt-get 源
apt-get update