在Ubuntu 24.04中设置国内镜像源可以加快软件下载速度,以下是具体步骤:
- 首先备份原有的源列表文件:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
- 编辑源列表文件(使用nano编辑器):
sudo nano /etc/apt/sources.list
- 清空文件中的内容,然后根据需要粘贴以下国内镜像源之一:
阿里云镜像源:
deb http://mirrors.aliyun.com/ubuntu/ noble main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ noble main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ noble-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ noble-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ noble-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ noble-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ noble-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ noble-backports main restricted universe multiverse
清华大学镜像源:
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-backports main restricted universe multiverse
-
保存并退出编辑器(按Ctrl+O保存,Ctrl+X退出)
-
更新软件源缓存:
sudo apt update
- (可选)升级系统软件:
sudo apt upgrade -y
完成以上步骤后,你的Ubuntu 24.04系统就已经使用国内镜像源了,软件下载速度会有明显提升。