跳到主要内容
极客日志极客日志面向AI+效率的开发者社区
首页博客我的书AI学习GitHub 精选镜像AI 生图工具UI配色美学关于
搜索内容 / 工具 / 仓库 / 镜像...⌘K搜索
注册
博客列表
Shell / Bash

Ubuntu 24.04 LTS 配置清华大学镜像源加速下载与更新

Ubuntu 24.04 LTS 默认软件源配置文件变更为 DEB822 格式(路径为 /etc/apt/sources.list.d/ubuntu.sources)。如何查看系统版本代号,备份原配置文件,并替换为清华大学镜像源地址以加速 apt 更新。同时提供了传统 One-Line 格式与新格式的完整配置示例,并提示生产环境慎用安全源切换。

苹果系统发布于 2026/3/27更新于 2026/9/1219K 浏览

参考链接

Ubuntu 软件仓库地址

在 Ubuntu 24.04 之前,Ubuntu 的软件源配置文件使用传统的 One-Line-Style,路径为 /etc/apt/sources.list;从 Ubuntu 24.04 开始,Ubuntu 的软件源配置文件变更为 DEB822 格式,路径为 /etc/apt/sources.list.d/ubuntu.sources。

检查系统版本

可以通过以下命令查看当前系统版本:

cat /etc/os-release

例如在 Ubuntu 24.04 下,文件内容如下:

PRETTY_NAME="Ubuntu 24.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.1 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo

VERSION_ID 后面的版本号即为当前系统版本,VERSION_CODENAME 后面的是代号。代号在软件源配置文件中会被使用。请注意在下面的配置中选择符合你的机器的版本号,在替换配置前确认代号一致,否则之后的更新操作可能导致系统出现问题。

配置内容

将系统自带的对应文件做个备份,然后根据格式的选择下面对应的内容替换,即可使用选择的软件源镜像。

传统格式(/etc/apt/sources.list)
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
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-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
# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
deb http://security.ubuntu.com/ubuntu/ noble-security main restricted universe multiverse
# deb-src http://security.ubuntu.com/ubuntu/ noble-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-proposed main restricted universe multiverse
# # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-proposed main restricted universe multiverse
DEB822 格式(/etc/apt/sources.list.d/ubuntu.sources)
Types: deb
URIs: https://mirrors.tuna.tsinghua.edu.cn/ubuntu
Suites: noble noble-updates noble-backports
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
# Types: deb-src
# URIs: https://mirrors.tuna.tsinghua.edu.cn/ubuntu
# Suites: noble noble-updates noble-backports
# Components: main restricted universe multiverse
# Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
Types: deb
URIs: http://security.ubuntu.com/ubuntu/
Suites: noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
# Types: deb-src
# URIs: http://security.ubuntu.com/ubuntu/
# Suites: noble-security
# Components: main restricted universe multiverse
# Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
# 预发布软件源,不建议启用
# Types: deb
# URIs: https://mirrors.tuna.tsinghua.edu.cn/ubuntu
# Suites: noble-proposed
# Components: main restricted universe multiverse
# Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
# # Types: deb-src
# # URIs: https://mirrors.tuna.tsinghua.edu.cn/ubuntu
# # Suites: noble-proposed
# # Components: main restricted universe multiverse
# # Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

因镜像站同步有延迟,可能会导致生产环境系统不能及时检查、安装上最新的安全更新,不建议替换 security 源。

建议访问官网查看配置,那里可以选择不同 Ubuntu 版本。

目录

  1. 参考链接
  2. 检查系统版本
  3. 配置内容
  4. 传统格式(/etc/apt/sources.list)
  5. 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
  6. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble main restricted universe multiverse
  7. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-updates main restricted universe multiverse
  8. deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-backports main restricted universe multiverse
  9. 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
  10. deb-src http://security.ubuntu.com/ubuntu/ noble-security main restricted universe multiverse
  11. 预发布软件源,不建议启用
  12. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-proposed main restricted universe multiverse
  13. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ noble-proposed main restricted universe multiverse
  14. DEB822 格式(/etc/apt/sources.list.d/ubuntu.sources)
  15. 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
  16. Types: deb-src
  17. URIs: https://mirrors.tuna.tsinghua.edu.cn/ubuntu
  18. Suites: noble noble-updates noble-backports
  19. Components: main restricted universe multiverse
  20. Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
  21. 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
  22. Types: deb-src
  23. URIs: http://security.ubuntu.com/ubuntu/
  24. Suites: noble-security
  25. Components: main restricted universe multiverse
  26. Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
  27. 预发布软件源,不建议启用
  28. Types: deb
  29. URIs: https://mirrors.tuna.tsinghua.edu.cn/ubuntu
  30. Suites: noble-proposed
  31. Components: main restricted universe multiverse
  32. Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
  33. # Types: deb-src
  34. # URIs: https://mirrors.tuna.tsinghua.edu.cn/ubuntu
  35. # Suites: noble-proposed
  36. # Components: main restricted universe multiverse
  37. # Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

更多推荐文章

查看全部
  • 基于优化理论的相位恢复算法
  • Spring AI 与 Spring AI Alibaba:关系解析、能力对比与选型指南
  • VibeVoice 与 Whisper 组合:构建本地语音双工交互系统
  • Linux 基础入门:常用命令与系统管理指南
  • Python 爬虫实战:DrissionPage 之 SessionPage 与 WebPage 模块详解
  • 飞书机器人联动 Claude Code:打造移动端 AI 编程助手
  • 基于 Simulink 的协作机器人末端执行器抓取控制仿真
  • 利用 Figma 插件将 AI 生成的 HTML 原型导入 Axure
  • Ubuntu 22.04 配置 VMware 共享文件夹实战指南
  • C++ STL 算法详解
  • 《Agent Runtime 工程化》第十章 Eval Harness 与 CI 回归:10.6 prompt A/B 与 runtime 策略对比
  • 构建 AI 终端生态:视觉感知驱动的实体交互实战
  • 基于 4x Tesla P40 训练 Llama-3.3-70B 大模型指南
  • 基于 Spring Boot 的智驿 AI 系统项目介绍与功能实现
  • 动态规划路径问题入门:核心定义与 LeetCode 例题解析
  • Rust 异步微服务架构最佳实践与反模式规避
  • LiuJuan Z-Image Generator 本地部署与 8K 人像生成指南
  • Playwright 现代 Web 自动化测试入门与实战指南
  • 移动前端与 Web 前端开发的核心差异解析
  • 北京理工大学网络与信息安全专业考研备考经验分享

相关免费在线工具

  • Base64 字符串编码/解码

    将字符串编码和解码为其 Base64 格式表示形式即可。 在线工具,Base64 字符串编码/解码在线工具,online

  • Base64 文件转换器

    将字符串、文件或图像转换为其 Base64 表示形式。 在线工具,Base64 文件转换器在线工具,online

  • Markdown转HTML

    将 Markdown(GFM)转为 HTML 片段,浏览器内 marked 解析;与 HTML转Markdown 互为补充。 在线工具,Markdown转HTML在线工具,online

  • HTML转Markdown

    将 HTML 片段转为 GitHub Flavored Markdown,支持标题、列表、链接、代码块与表格等;浏览器内处理,可链接预填。 在线工具,HTML转Markdown在线工具,online

  • JSON 压缩

    通过删除不必要的空白来缩小和压缩JSON。 在线工具,JSON 压缩在线工具,online

  • JSON美化和格式化

    将JSON字符串修饰为友好的可读格式。 在线工具,JSON美化和格式化在线工具,online