“media change: please insert the disc labeled” when trying to install Ruby on Rails [duplicate]

本文解答了在使用Ubuntu系统时遇到的一个常见问题:当尝试通过sudo apt-get install rails命令安装软件包时,系统错误地提示用户插入安装光盘。文章提供了移除sources.list文件中过时CD-ROM条目的解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

This question already has an answer here:

When I type sudo apt-get install rails I get the message:

media change: please insert the disc labeled
'Ubuntu 12.04.3 LTS _Precise Pangolin_ - Release amd64 (20130820.1)
in the drive '/media/cdrom/' and press enter

I am new to Linux and I have the installation CD in the drive, but I have no idea what disc it is asking for and I'm not sure what /media/cdrom/ means. All I have is the installation CD and it is in the only optical drive I have.

share improve this question

marked as duplicate by Anwar, Eric Carvalho, Braiam, belacqua, Richard May 11 '14 at 0:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

 

Just remove the cdrom entry from the sources.list file. This can be done easily:

sudo sed -i '/cdrom/d' /etc/apt/sources.list

This should take care of the problem. The message is because somehow you still have the cdrom entry in your sources.list file, you can check the content of the file using:

grep -v '#' /etc/apt/sources.list

This will show you all the repositories you have activated.

share improve this answer
 
 
Which commands enable the DVD/CD on the installation USB stick, if one decides to continue using the packages on the downloaded ISO? –  user75798 Mar 25 '14 at 5:41
 
@user75798 you know that all the packages provided in the ISO are already installed, right? –  Braiam Mar 25 '14 at 6:06
 
A more cautious approach would be to edit the sources.list vi /etc/apt/sources.list and add a # in the lines to be removed. –  Underverse May 14 at 13:05
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值