sudo apt-get install -y python-pip: Media change: please insert the disc labeled

At the time of installation ,

sudo apt-get install -y python-pip 

this error is occured. I have seen the solution on askubuntu that just comment out the single line as shown in below the problem. Please anybody know about it ? Thanks in advance.

Media change: please insert the disc labeled 'Ubuntu 14.04 LTS _Trusty Tahr_ - Release amd64 (20140417)' in the drive '/media/cdrom/' and press enter 

Solution on askubuntu The issue is fairly simple, you have the CDROM entry in your /etc/apt/sources.list. Just remove/comment out the line, and you will be fine:

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

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Site Moderator
Site Moderator badge
July 18, 2023


The error message you’re seeing is because your package manager (apt) is configured to look for packages on a CD-ROM disc, which was a common distribution method for Linux distributions, including Ubuntu.

The solution provided on askubuntu is correct. The command given will comment out (i.e., disable) any lines in the /etc/apt/sources.list file that mention ‘cdrom’, which are the ones causing apt to look for a CD-ROM.

Here’s a more detailed description of what to do:

  1. Open a terminal.

  2. Type in the following command:

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

and press enter.

  1. You’ll be asked for your password. Type it in and press enter.

This command works as follows:

  • sudo: Run the command as the root user. You need root permissions to edit the sources.list file.
  • sed: This is a stream editor for filtering and transforming text.
  • -i: This option to sed makes it edit files in-place (i.e. it changes the actual file).
  • '/cdrom/d': This is the sed command that gets run on the file. It says “delete any line that contains ‘cdrom’”.
  • /etc/apt/sources.list: This is the file that sed will edit. This file contains the list of places apt will look for packages.

After running this command, your system will no longer look for packages on a CD-ROM, and you should be able to run the apt-get install command without seeing that error message.

Remember to run sudo apt-get update to update your package lists after making this change.

Ryan Quinn
DigitalOcean Employee
DigitalOcean Employee badge
January 19, 2015

The thread on askubuntu was correct. You need to comment out the CDROM line(s) in your /etc/apt/sources.list and then run an apt-get update

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel