Fix the apt-get install error: “Media change: please insert the disc labeled ...” on your Linux VPS

Introduction


In order to avoid Debian to search for packages on a non-existent CDROM, which is most likely not present on a Linux VPS, you should change a simple parameter on the /etc/apt/sources.list file. You need to modify the aforementioned file if you get an output like this while using apt-get to install default packages:

Media change: please insert the disc labeled
 'Debian GNU/Linux 7.0.0 _Wheezy_ - Official amd64 CD Binary-1 20130504-14:44'
in the drive '/media/cdrom/' and press enter

 

Open and modify the file /etc/apt/sources.list

vi /etc/apt/sources.list

 

You will see an output like this:

#

deb cdrom:[Debian GNU/Linux 7.0.0 _Wheezy_ - Official amd64 CD Binary-1 20130504-14:44]/ wheezy main

deb http://ftp.us.debian.org/debian/ wheezy main
deb-src http://ftp.us.debian.org/debian/ wheezy main

deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main

# wheezy-updates, previously known as 'volatile'
deb http://ftp.us.debian.org/debian/ wheezy-updates main
deb-src http://ftp.us.debian.org/debian/ wheezy-updates main
~

 

This file contains all your package sources. You might find a deb cdrom:[Debian GNU/Linux 7.0.0 _Wheezy_ - Official amd64 CD Binary-1 20130504-14:44]/ wheezy main line indicating a local CDROM as a package source. Comment it out by placing a # symbol at the beginning of the line and save the file.

 

You should leave it like this:

#

# deb cdrom:[Debian GNU/Linux 7.0.0 _Wheezy_ - Official amd64 CD Binary-1 20130504-14:44]/ wheezy main

deb http://ftp.us.debian.org/debian/ wheezy main
deb-src http://ftp.us.debian.org/debian/ wheezy main

deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main

# wheezy-updates, previously known as 'volatile'
deb http://ftp.us.debian.org/debian/ wheezy-updates main
deb-src http://ftp.us.debian.org/debian/ wheezy-updates main
~

 

Now that you have fixed the apt-get CDROM error, you are ready to resynchronize the package index files and install your services on Debian:

 

Enjoy!

 

Test on a Miami VPS Now

or

Deploy on a Miami Dedicated Server

  • 181 Users Found This Useful
Was this answer helpful?

Related Articles

Changing outgoing SMTP email on Postfix MTA.

Changing outgoing SMTP email on Postfix MTA.   Most of the time, email servers rejects emails...

How to install CentOS 6.x with Netinstall on your Linux VPS

Introduction If you want to do your own installation of CentOS on your Linux VPS, you can get...

How to make backups of your VPS.

Introduction When you work with a VPS or even any kind of server architecture, is extremely...

Change IP address on CentOS VPS Server

In this tutorial, we'll give you a step by step description on how to change your server's IP...

Add VirtIO Ethernet Drivers to a Windows VPS

Make sure to install the VirtIO Drivers in order for you Windows VPS to install the correct...