系统相关
首页 > 系统相关> > Ubuntu如何换源?

Ubuntu如何换源?

作者:互联网

1、进入root权限用户

1| su

root前

image

root后

image

2、备份源文件

1| sudo cp -v /etc/apt/sources.list /etc/apt/sources.list.backup

3、修改源文件

1| vim /etc/apt/sources.list

tips:如果出现Command 'vim' not found,but can be install with:
可以安装一下vim

1| apt install vim

image

进入大概是这样的界面

然后一直按 d 直到界面是空为止
然后按 i 进入编辑模式
复制文章下面的源,然后鼠标右键粘贴
然后按Esc退出编辑
输入 :wq* 退出
image

4、更新源

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse

点击查看代码
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse

标签:cn,mirrors,restricted,edu,如何,换源,https,Ubuntu,multiverse
来源: https://www.cnblogs.com/lilbai518/p/15970237.html