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

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

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

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

参考链接

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
  • 💰 8折买阿里云服务器限时8折了解详情
  • Magick API 一键接入全球大模型注册送1000万token查看
  • 🤖 一键搭建Deepseek满血版了解详情
  • 一键打造专属AI 智能体了解详情
极客日志微信公众号二维码

微信扫一扫,关注极客日志

微信公众号「极客日志V2」,在微信中扫描左侧二维码关注。展示文案:极客日志V2 zeeklog

更多推荐文章

查看全部
  • Stable Diffusion 模型技术深度解析
  • Java 设计模式:单例、工厂与代理模式
  • ScreenFilter 智能助手:低代码构建屏幕内容分析工作流
  • R 语言网络爬虫技术快速入门与法律合规指南
  • Python 数据分析基础:NumPy 核心用法详解
  • Android 中高级开发工程师面试核心知识点总结
  • Git 合并冲突的常见场景与解决技巧
  • OpenClaw 飞书 AI 机器人搭建指南
  • Open WebUI 新技术 MCPo:实现 MCP 协议到 OpenAPI 的无缝集成
  • GTC2026 前瞻:Agentic AI 开源模型与 Physical AI 机器人趋势
  • ERNIE-4.5-0.3B 超轻量模型部署与测评指南
  • C++ 高效碰撞检测实现与物理引擎性能优化
  • OpenClaw 集成至飞书构建自动化办公智能体
  • CLAUDE.md 与 AGENTS.md 配置指南:让 AI 编程助手理解你的项目
  • OpenAI 发布最强推理模型 o1,性能超越人类专家
  • 用 Python 构建跨平台 GUI 与 Web 应用:Flet 框架实战
  • Python AI 开源工具精选:从 Agent 框架到大模型推理实战
  • OnlyOffice 社区版 Docker 部署及文档无法保存问题排查
  • 基于阿里云部署 Moltbot 开源 AI 代理指南
  • Qwen3-TTS-Tokenizer-12Hz在AR眼镜实时语音交互中的低延迟应用
  • 相关免费在线工具

    • 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