Debian 12 CD-ROM 源修改为网络源

分类:技术 57浏览

一台机器安装Debian时选择了CD-ROM作为更新源,apt-get 时提示如下错误:

Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs

一、编辑文件

vim /etc/apt/sources.list

二、加#注释掉CDROM 那行源

#cdrom://[Debian GNU/Linux 12.1.0 _Bookworm_ - Official amd64 DVD

三、添加官方源

deb http://deb.debian.org/debian/ bookworm main contrib non-free
deb http://deb.debian.org/debian/ bookworm-updates main contrib non-free
deb http://security.debian.org/debian-security bookworm-security main contrib non-free

四、更新即可

apt-get update
apt-get dist-upgrade
apt-get upgrade