Ubuntu apt 源修改为国内的阿里云镜像源

查看当前系统的版本信息

$ lsb_release -a

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 21.04
Release:    21.04
Codename:   hirsute

备份默认的源

$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

修改为国内的阿里云镜像源

$ sudo sed -i "s/archive.ubuntu.com/mirrors.aliyun.com/g" /etc/apt/sources.list

删除注释行

$ sed -i '/^#/d' /etc/apt/sources.list

更新 apt-get 源

$ sudo apt-get update

你可能感兴趣的:(Ubuntu apt 源修改为国内的阿里云镜像源)