检查并修正官方软件源
nano /etc/apt/sources.list
替换内容为如下:
deb https://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmware
#deb-src https://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmware
deb https://deb.debian.org/debian/ bookworm-updates main contrib non-free non-free-firmware
#deb-src https://deb.debian.org/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://deb.debian.org/debian/ bookworm-backports main contrib non-free non-free-firmware
#deb-src https://deb.debian.org/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://deb.debian.org/debian-security/ bookworm-security main contrib non-free non-free-firmware
#deb-src https://deb.debian.org/debian-security/ bookworm-security main contrib non-free non-free-firmware
nano 是系统自带的编辑器,简单的使用方法指引:
Ctrl + K 删除光标所在行。如果要全部删除后复制粘贴,一直按直到全部清空为止
Shift + Insert 粘贴。有的键盘可能标记的是Ins
Ctrl + X 退出。需要按Y回车确认保存修改。
此操作可在系统安装完成后优先开始。如果是 Debian 11 升级到 Debian 12,可在完成软件源修改后 apt update,然后执行 apt full-upgrade等待运行完成即可从 11 升级到 12,确认需要按Y。以上请谨慎操作先做好数据备份防止出错不可恢复。如果一切正常,接下来apt dist-upgrade完整的版本升级。如果已经是12,编辑完成后直接运行:
apt update
apt upgrade
确认需要按Y回车。熟悉后手打命令可以直接写 apt upgrade -y 省略确认动作,节约时间。
如果是国内机器,建议使用国内的例如清华源、网易源等。具体请自行搜索获取。