Ubuntu20.04更换国内源

2023-03-31 15:51:30 6428

安装Ubuntu20.04系统后,下载安装软件包使用默认的国外源太慢了,因此我们可以把源修改为国内源这个样会快很多

1、首先以root用户登录主机。

image.png

2、进入源文件目录。
root@lanan:~# cd /etc/apt

root@lanan:/etc/apt#

image.png

3、保险起见先备份一下原来的源文件,避免更换出问题可以还原回去哈哈哈。
root@lanan:/etc/apt# cp sources.list sources.list.bak

image.png

4、修改源。
root@lanan:/etc/apt# vi sources.list
国外源:

image.png

然后把国外源删除或用#注释后更换成我们想要的国内源,这里我修改为阿里源。
阿里源:

image.png

5、最后更新下源和软件。(第一次更新有点慢耐心等待!更新完我们下载安装软件包就会快很多了)

root@lanan:/etc/apt# apt update
root@lanan:/etc/apt# apt upgrade
6、附:常用源。
阿里源:
deb http://www.landui.com/ubuntu/ bionic main restricted universe multiverse

deb-src http://www.landui.com/ubuntu/ bionic main restricted universe multiverse

deb http://www.landui.com/ubuntu/ bionic-security main restricted universe multiverse

deb-src http://www.landui.com/ubuntu/ bionic-security main restricted universe multiverse

deb http://www.landui.com/ubuntu/ bionic-updates main restricted universe multiverse

deb-src http://www.landui.com/ubuntu/ bionic-updates main restricted universe multiverse

deb http://www.landui.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb-src http://www.landui.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb http://www.landui.com/ubuntu/ bionic-backports main restricted universe multiverse

deb-src http://www.landui.com/ubuntu/ bionic-backports main restricted universe multiverse

中科大源:
deb https://www.landui.com/ubuntu/ bionic main restricted universe multiverse

deb-src https://www.landui.com/ubuntu/ bionic main restricted universe multiverse

deb https://www.landui.com/ubuntu/ bionic-updates main restricted universe multiverse

deb-src https://www.landui.com/ubuntu/ bionic-updates main restricted universe multiverse

deb https://www.landui.com/ubuntu/ bionic-backports main restricted universe multiverse

deb-src https://www.landui.com/ubuntu/ bionic-backports main restricted universe multiverse

deb https://www.landui.com/ubuntu/ bionic-security main restricted universe multiverse

deb-src https://www.landui.com/ubuntu/ bionic-security main restricted universe multiverse

deb https://www.landui.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb-src https://www.landui.com/ubuntu/ bionic-proposed main restricted universe multiverse

清华源:
deb https://www.landui.com/ubuntu/ bionic main restricted universe multiverse

deb-src https://www.landui.com/ubuntu/ bionic main restricted universe multiverse

deb https://www.landui.com/ubuntu/ bionic-updates main restricted universe multiverse

deb-src https://www.landui.com/ubuntu/ bionic-updates main restricted universe multiverse

deb https://www.landui.com/ubuntu/ bionic-backports main restricted universe multiverse

deb-src https://www.landui.com/ubuntu/ bionic-backports main restricted universe multiverse

deb https://www.landui.com/ubuntu/ bionic-security main restricted universe multiverse

deb-src https://www.landui.com/ubuntu/ bionic-security main restricted universe multiverse

deb https://www.landui.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb-src https://www.landui.com/ubuntu/ bionic-proposed main restricted universe multiverse

163源:
deb http://www.landui.com/ubuntu/ bionic main restricted universe multiverse

deb http://www.landui.com/ubuntu/ bionic-security main restricted universe multiverse

deb http://www.landui.com/ubuntu/ bionic-updates main restricted universe multiverse

deb http://www.landui.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb http://www.landui.com/ubuntu/ bionic-backports main restricted universe multiverse

deb-src http://www.landui.com/ubuntu/ bionic main restricted universe multiverse

deb-src http://www.landui.com/ubuntu/ bionic-security main restricted universe multiverse

deb-src http://www.landui.com/ubuntu/ bionic-updates main restricted universe multiverse

deb-src http://www.landui.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb-src http://www.landui.com/ubuntu/ bionic-backports main restricted universe multiverse





提交成功!非常感谢您的反馈,我们会继续努力做到更好!

这条文档是否有帮助解决问题?

非常抱歉未能帮助到您。为了给您提供更好的服务,我们很需要您进一步的反馈信息:

在文档使用中是否遇到以下问题: