# 备份源文件 sudocp /etc/apt/sources.list.d/ubuntu.sources /etc/apt/sources.list.d/ubuntu.sources.bak # 编辑源文件 sudo vim /etc/apt/sources.list.d/ubuntu.sources
注释掉原有的配置,并新增国内镜像源,配置如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#Types: deb #URIs: http://archive.ubuntu.com/ubuntu/ #Suites: noble noble-updates noble-backports #Components: main universe restricted multiverse #Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg ## Ubuntu security updates. Aside from URIs and Suites, ## this should mirror your choices in the previous section. #Types: deb #URIs: http://security.ubuntu.com/ubuntu/ #Suites: noble-security #Components: main universe restricted multiverse #Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
Types: deb deb-src URIs: https://mirrors.aliyun.com/ubuntu/ Suites: noble noble-security noble-updates noble-proposed noble-backports Components: main restricted universe multiverse Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg