当前位置:首页 > 系统教程 > 正文

Ubuntu 24.04.3 LTS APT更换国内源(手把手教你配置国内镜像源,速度飞起)

Ubuntu 24.04.3 LTS APT更换国内源(手把手教你配置国内镜像源,速度飞起)

Ubuntu 24.04.3 LTS APT更换国内源(手把手教你配置国内镜像源,速度飞起) 24.04源  国内APT源 Linux换源教程 软件源加速 第1张

关键词: Ubuntu 24.04源、国内APT源、Linux换源教程、软件源加速

对于使用Ubuntu 24.04.3 LTS (NobleNumbat) 的用户,默认的软件源服务器在国外,下载速度往往很慢。将APT源更换为国内镜像(如清华、阿里云、中科大等)可以显著提升软件包下载和系统更新速度。本文适合小白用户,每一步都有详细说明。

1. 确认Ubuntu版本

打开终端(快捷键Ctrl+Alt+T),输入以下命令确认系统版本是否为Ubuntu 24.04.3 LTS (NobleNumbat):

    lsb_release -a  

你应该看到类似 Description: Ubuntu 24.04.3 LTSCodename: noble 的信息。

2. 备份原有源列表

修改前先备份,以便出错时恢复:

    sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak  

3. 编辑源列表文件

使用nano或vim编辑sources.list:

    sudo nano /etc/apt/sources.list  

清空原有内容,填入以下国内镜像源(以清华源为例,你也可以选择阿里云、中科大等):

    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-updates main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-backports main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-security main restricted universe multiverse# deb-src 源(如需源码可取消注释)# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble main restricted universe multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-updates main restricted universe multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-backports main restricted universe multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-security main restricted universe multiverse  

按Ctrl+O保存,Ctrl+X退出(nano)。

4. 更新软件源并升级

运行以下命令更新软件包列表:

    sudo apt update  

如果看到大量下载信息且速度很快,说明换源成功。接着可以升级已安装软件:

    sudo apt upgrade -y  

5. 其他国内源推荐

除了清华源,阿里云和中科大源也同样稳定快速。例如阿里云Ubuntu 24.04源配置如下:

    deb https://mirrors.aliyun.com/ubuntu/ noble main restricted universe multiversedeb https://mirrors.aliyun.com/ubuntu/ noble-updates main restricted universe multiversedeb https://mirrors.aliyun.com/ubuntu/ noble-backports main restricted universe multiversedeb https://mirrors.aliyun.com/ubuntu/ noble-security main restricted universe multiverse  

你可以根据喜好选择其中一个。至此,Ubuntu 24.04.3 LTS的APT国内源更换就完成了,享受飞一般的下载速度吧!

本文关键词:Ubuntu 24.04源、国内APT源、Linux换源教程、软件源加速 —— 记得在操作时替换为实际的国内镜像地址。