shiniei
shiniei
发布于 2025-11-07 / 11 阅读
0
0

💻 Debian 镜像源配置 (清华大学 + 官方)

💻 Debian 镜像源配置 (清华大学 + 官方)

❗重要提醒: 以下内容适用于 Debian 12 (Bookworm)。如果您的 Debian 版本不同,请将所有出现的 bookworm 替换为您的版本代号(例如:Debian 11 使用 trixie,Debian 11 使用 bullseye,Debian 10 使用 buster)。

1. 备份原有配置文件

Bash

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

2. /etc/apt/sources.list 完整内容

请使用编辑器(如 sudo nano /etc/apt/sources.list)打开文件,并用以下内容替换添加

代码段

# ----------------------------------------------------
# 官方 Debian 稳定版仓库
# ----------------------------------------------------
deb http://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmware
deb-src http://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmware

# 官方安全更新仓库
deb http://security.debian.org/debian-security/ bookworm-security main contrib non-free non-free-firmware
deb-src http://security.debian.org/debian-security/ bookworm-security main contrib non-free non-free-firmware

# 官方更新仓库 (推荐)
deb http://deb.debian.org/debian/ bookworm-updates main contrib non-free non-free-firmware
deb-src http://deb.debian.org/debian/ bookworm-updates main contrib non-free non-free-firmware

# 官方反向移植仓库 (Backports)
deb http://deb.debian.org/debian/ bookworm-backports main contrib non-free non-free-firmware
deb-src http://deb.debian.org/debian/ bookworm-backports main contrib non-free non-free-firmware


# ----------------------------------------------------
# 清华大学镜像源 (TUNA)
# 
# **注意:** 以下链接中的 'bookworm' 应根据您的 Debian 版本进行修改。
#   - Debian 11: bullseye
#   - Debian 10: buster
# ----------------------------------------------------

# Debian 稳定版仓库 (main, contrib, non-free, non-free-firmware)
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware

# Debian 安全更新仓库
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware

# Debian 更新仓库 (updates/proposed updates)
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware

# Debian 反向移植仓库 (Backports)
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware

3. 更新软件包列表

保存并关闭 /etc/apt/sources.list 文件后,运行以下命令更新软件包索引:

Bash

sudo apt update

评论