I installed Debian 7 using a DVD version, so every time I'm trying to install something using apt-get, the system ask me to mount the DVD. Is there a way to avoid that (inserting every time the dvd).

  • Editing Repositories lists doesn't help? – IBr Jul 18 '13 at 20:56

You could copy the DVD to an ISO and then mount it permanently as a filesystem on the machine (and point apt at it, by modifying /etc/apt/sources.list). However, assuming the machine has an Internet connection, you could just switch to using the online repositories.

Details are here.

But here's an example,

Edit /etc/apt/sources.list and replace the contents with this (this works for Wheezy or Debian 7, for earlier or later versions, check the link above),

deb http://http.debian.net/debian wheezy main contrib non-free
deb-src http://http.debian.net/debian wheezy main contrib non-free

deb http://http.debian.net/debian wheezy-updates main contrib non-free
deb-src http://http.debian.net/debian wheezy-updates main contrib non-free

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

Then run apt-get update to refresh the package details.

  • I tied :#root: "gedit /etc/ ... " cant access the file, i tried too, chmod 777 /etc .." but no sccess, im wondering how is possible to access that file ! – timmz Jul 18 '13 at 21:02
  • So your question is wrong, your question needs to be 'I tried to edit /etc/apt/sources.list but can't'. You really need to make sure you've given everyone all the info before asking questions. – EightBitTony Jul 18 '13 at 21:03
  • I can access it now. do i have to reaplace all the content of the file, or just add lines in the end ? – timmz Jul 18 '13 at 21:05
  • Replace all of it, with what I have provided above. – EightBitTony Jul 18 '13 at 21:05
  • Is there a command line option to do it? I'm literally trying to install emacs, so I don't have a text editor at the moment. – user56041 Sep 13 '17 at 7:22

Just a caveat here.

If you're dealing with some problem where you've got incorrect settings in /etc/apt/sources.list, e.g. a disk is expected, it's probably a good idea to to rewrite the file from scratch.

To do this for Debian I just used https://debgen.simplylinux.ch/ to generate the file.

Initially I just tried just removing the reference from sources.list as recommended, but then I subsequently got other errors when trying to update packages, such as

Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution...`


git : Depends: liberror-perl but it is not installable

These came up for me because my version of sources.list didn't point to the package sources I needed, however regenerating sources.list fixed this problem.


I needed some insight so after reading these posts I used nano to edit the /etc/apt/sources.list file, i.e.

# nano /etc/apt/sources.list

Once in the file, the first source was the CD pointer so all I had to do was to comment that line out with the # character and all was fixed. I'm now getting the packages from the repositories listed in the sources.list file.

Thanks for the help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.