Ubuntu换源(本地)
作者 原文链接:https://blog.csdn.net/MacWx/article/details/137689898
查询系统版本
lsb_release -a
系统版本是 Ubuntu 20.04.6 LTS,注意这个开发代号Codename
,Ubuntu每一个版本都有一个代号,这个一定要跟国内源对应,否则会出问题。
阿里云Ubuntu镜像:https://developer.aliyun.com/mirror/ubuntu
ubuntu 20.04 LTS (focal) 配置如下
我系统版本是20.04,所以可以从下面镜像信息中看到都是focal代号的。
deb https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiversedeb https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiversedeb https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse# deb https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiversedeb https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
更换方法
1.备份
sudo cp /etc/apt/sources.list /etc/apt/sources.list.back
2.编辑
打开vim编辑器,把sources.list文件中所有的deb文件全部注释掉或者删除掉,然后把上面给的国内镜像复制去就可以。
vim /etc/apt/sources.list
3.更新软件源
sudo apt update
sudo apt upgrade
————————————————
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/MacWx/article/details/137689898