ubuntu apt 安装报错:Media change: please insert the disc labeled 'Ubuntu 20.04.5 LTS Focal Fossa - Release amd64 (20220831)' in the drive '/cdrom/' and press [Enter]

前言

如果你在 Ubuntu 上使用 apt 安装软件包时遇到 "Media change: please insert the disc labeled ..." 的错误消息,这通常是因为 apt 源列表中包含 CD/DVD 源,但你的系统中没有插入相应的安装介质(CD 或 DVD)。

解决

检查 /etc/apt/sources.list文件中,是否出现 CD/DVD 源。

类似 deb cdrom:[Ubuntu 20.04.5 LTS _Focal Fossa_ - Release amd64 (20220831)]/ focal main restricted 的行,则表示你的 apt 源列表中包含 CD/DVD 源。

编辑 /etc/apt/sources.list 文件,使用 # 注释 CD/DVD 源所在行,然后保存文件。

更新 apt 缓存,并清除旧的源信息:

sudo apt-get update
sudo apt-get clean
posted @ 2023-05-10 22:38  牛奔  阅读(416)  评论(0编辑  收藏  举报