1.配置 apt 源
打开 /etc/apt/sources.list 文件
bash
nano /etc/apt/sources.list如果看到类似下面的行:
bash
deb cdrom:[Debian GNU/Linux 12.7.0 _Bookworm_ - Official amd64 DVD Binary-1 with firmware 20240831-10:40] bookworm main将这些行注释掉(在行首添加 #)或直接删除它们。最终文件内容可能会像下面这样:
bash
# deb cdrom:[Debian GNU/Linux 12.7.0 _Bookworm_ - Official amd64 DVD Binary-1 with firmware 20240831-10:40] bookworm main添加清华大学源
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bookworm-security main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free最终文件内容可能会像下面这样:

2.更新软件包
bash
apt update3.升级已安装的软件包
bash
apt upgrade -y