美文网首页
Ubuntu apt 源修改为国内的阿里云镜像源

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

作者: 乌云龙 | 来源:发表于2021-10-29 10:21 被阅读0次

查看当前系统的版本信息

$ 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 源修改为国内的阿里云镜像源

      本文链接:https://www.haomeiwen.com/subject/vokialtx.html