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

Discussion in 'Tutorials and Guides' started by Roger, Nov 23, 2013.

  1. Roger

    Roger New Member Verified Provider

    45
    3
    Oct 8, 2013
    Introduction

    ------------

    In order to avoid Debian to search for packages on a non-existent CDROM, which is most likely not present on a 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:

    Code:
    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


    Code:
    vi /etc/apt/sources.list
    You will see an output like this:


    Code:
    #
    
    
    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:


    Code:
    #
    
    
    # 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!
     
  2. scv

    scv Massive Nerd Verified Provider

    205
    98
    May 30, 2013
    scv
    Just curious - what provider leaves the cdrom entry in their package manager's sources list?!
     
  3. WebSearchingPro

    WebSearchingPro VPS Peddler Verified Provider

    493
    143
    May 15, 2013
    The official Debian 7.x ISO's do this after installation.
     
  4. HalfEatenPie

    HalfEatenPie The Irrational One Retired Staff

    2,890
    1,385
    Mar 25, 2013
    HalfEatenPie
    Huh? Odd. I do recall the Debian ISO being left in the source list but it was commented out.

    Of course I usually use the netinstall ISO.
     
  5. MassNodes

    MassNodes New Member

    3
    0
    Nov 17, 2013
    If you configure your NIC upon install along with selecting a repository, it will comment out the CD line and add the web based ones. So that begin said, if the CD & web repository information are in the sources; it would be more likely that this is a custom configuration error. (Post install script by host?)