Debian apt-get installer asking to insert CD install disk

inThis blog post describes why Debian is asking you to insert a CD while using apt-get and how you can stop this.

Why apt-get asks for a DVD

If you installed Debian via the install DVD it will set up apt to install from the DVD. This is because the DVD can be used as installation material for offline computers. In my case my virtual machine is online and I want to install and receive updates from the internet by default.

To remove the DVD from the list of installation media you need to edit /etc/apt/sources.list. This file will have a line in it that looks like the below:

deb cdrom:[Debian GNU/Linux 9.0.0 _Stetch_ - Offical amd DVD Binary-1 20170617-13:08]/ stretch main

If you want to disable installing from the CD this line needs to be removed or commented out. You can comment out the line by puting a #in front of the line.

To edit the file you will need edit the file with root privileges. This can be run by running the series of comments

su
nano /etc/apt/sources.list
OR
vim /etc/apt/sources.list

Running su and entering the password will open a root shell. Once there you can edit the file using nano or vim or any preferred editor. For those new to the command line I recommend nano as instructions to use the program are printed at the bottom of the window.

Hopefully this will help some people new to Debian or who hit this issue like I did.

Add a Comment

Your email address will not be published. Required fields are marked *