Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I used ubuntu linux before, and I installed debian OS on my labtop using DVDs that I burned. But when I'm trying to use apt-get to install software, the system always asks me to insert disk to proceed. I wonder if there is a way to change the repository configuration so that I can retrieve installation files online instead of using disks.

share|improve this question
I just found out that it's the sources.list file that have caused the problem. But after I comment the "deb cdrom" thing, I'm no longer able to get any software update :( Does anyone have a nice sources.list file? – Shang Wang Jul 9 '11 at 23:59

1 Answer 1

up vote 13 down vote accepted

Package sources are listed in /etc/apt/sources.list and /etc/apt/sources.list.d/*.list. Usually you would list official sources in the main file /etc/apt/sources.list and add third-party repositories in /etc/apt/sources.list.d/indicative_name.list.

If you installed from CD-ROM, there'll be a line with

deb cdrom:[some name]/ stable main

Remove it or comment it out (by adding a # at the beginning of the line). If you ever want to install from CD-ROM again, pop the CD in and run apt-cdrom to create a sources.list entry from that CD-ROM.

To install packages over the Internet, you would typically list a Debian mirror as a source. The system installation does this if you have an Internet connection. A typical set of entries look like this:

## Debian stable proper
deb squeeze main non-free contrib
deb-src squeeze main non-free contrib

## Security updates
deb squeeze/updates main contrib non-free
deb-src squeeze/updates main contrib non-free

## Other updates to the stable release (formerly volatile)
deb squeeze-updates main contrib non-free
deb-src squeeze-updates main contrib non-free

## Quasi-official backports
deb squeeze-backports main non-free contrib
deb-src squeeze-backports main non-free contrib

## Marillat: multimedia support and other less free or stable stuff
deb squeeze main
deb-src squeeze main
  • Replace squeeze by testing or unstable or whatever distribution you follow.
  • Remove contrib and non-free if you want to install free software exclusively.
  • If you don't live in France, replace by the name of another Debian mirror.
  • The deb lines are for binary packages, the deb-src lines are for source packages. If you never want to download sources, you don't need the deb-src lines. If you do, you need a deb-src line to match each deb line.
  • Only two sources are strictly necessary: the distribution proper (protocol:// release_name main) and security updates (deb release_name/updates). Include the others only if you want them:

    • stable-updates are updates of databases that need to be kept current, such as virus signature lists. Applies to the stable release only.
    • Backports are pacakges from unstable that are recompiled for stable. Even if you include this source, the packages will only be installed on explicit request: if a package also has a version outside backports, the non-backports version will be preferred even if it's older. Applies to the stable release only.
    • Debian multimedia has packages that don't meet the legal requirements of the main distribution. They're mainly useful for desktop machines, to support more audio and video formats.

There are many other unofficial repositories if you're after a specific application.

share|improve this answer
you r awesome, gilles!! – Shang Wang Jul 10 '11 at 0:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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