root@ubuntu:~# apt update
Get:1 file:/cdrom jammy InRelease
Ign:1 file:/cdrom jammy InRelease
Get:2 file:/cdrom jammy Release
Err:2 file:/cdrom jammy Release
File not found - /cdrom/dists/jammy/Release (2: No such file or directory)0% [Connecting to cn.archive.ubuntu.com (2403:2c80:5::6)]0% [Connecting to cn.archive.ubuntu.com (2403:2c80:5::6)]
1.2、解决方法
//移除CD-ROM源 通过编辑 /etc/apt/sources.list 文件,
//移除或注释掉与 cdrom 相关的行 然后执行apt update
sudonano /etc/apt/sources.list
//使用清华大学的镜像源:
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
//或者使用官方的 Ubuntu 源:
deb http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
前面加上 # 注释掉
Ctrl + X 退出编辑器 n 不保存 y 保存
//更新软件包列表
sudoapt update