80

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.

Braiam
  • 67,791
  • 32
  • 179
  • 269
user222230
  • 901
  • 1
  • 6
  • 3

1 Answers1

153

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.

Braiam
  • 67,791
  • 32
  • 179
  • 269
  • 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 05:41
  • 1
    @user75798 you know that all the packages provided in the ISO are already installed, right? – Braiam Mar 25 '14 at 06:06
  • 12
    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 '17 at 13:05
  • 4
    This seems to occur when installing Ubuntu 20.04 with third party sources enabled. (The third party install fails due to some configuration stuff and causes the install to not finish properly, which I suspect leads to this entry not being removed). I'm just adding this comment for SEO's sake. Thanks a lot :) – johannesack Dec 02 '20 at 19:23
  • 1
    @JohannesAckermann yep, related question on this site, launchpad bug report, the response is more or less "we'll fix it in February" – jrh Dec 16 '20 at 17:51