"Everything is funny so long as it is happening to somebody else." - Will Rogers

Beginner's Guide to Debian Etch

Wednesday 11th April 2007

Categories: Guides, GNU/Linux, FLOSS

Installing Packages

Debian installs packages using a very useful program called apt. By typing apt-get install program1 program2 (and so on), apt will automatically work out what other packages are required to install the programs selected. Before we start installing packages, you can take a look at /etc/apt/sources.list. The easiest way to do this is to become root by typing su (to configure apt requires root privileges), and then nano /etc/apt/sources.list. If you supplied the CD, there should be a line that starts:

deb cdrom:[Debian GNU/Linux...

This means that apt searches for packages from the CD-ROM. If you don't want to use the CD anymore, and just grab the packages from the web instead, you should place a # at the start of this line to comment it out. If you didn't add a network mirror during the installation, you can now add another line so that we can get packages from the internet. The Debian website has a a long list of mirrors. Since I am in Britain, I would add this line below the CD-ROM:

deb ftp://ftp.uk.debian.org/debian/ etch main contrib non-free

This line is fairly simple. The address is just that: the address for the packages. The next word refers to the version of Debian - you should make it match the version of Debian you have installed e.g. stable, testing, unstable. You can also refer directly to the codename of the version i.e. etch, lenny and sid respectively. Note that using the version or codename does make a difference, but only when a new stable version is released. Imagine you're using testing, the codename of which is currently lenny. If you've specified lenny in sources.list, then when lenny turns into stable, you'll now have a stable Debian system, rather than testing. However, if you've specified testing in sources.list, you'll stick with testing and move onto whatever the codename of the next release is.

The next three words refer to the various groups of packages - main, contrib and non-free. I would add all three so that you get the full range of packages, although you may wish to omit contrib and non-free. contrib contains packages that are deemed free by Debian, but rely on non-free software. non-free is software that can be distributed by Debian, but is not considered free by Debian.

Now that we have added the line, we can exit by pressing Control and X, choosing to save when asked. Next, we want to update apt by typing apt-get update. Apt will then fetch the package list from the new source. If it produces an error, make sure you have not made any errors within /etc/apt/sources.list.

So, what do we want to install? Well, if you didn't install a desktop environment, the interface is still fairly sparse. If you did choose to install a desktop environment, feel free to skip ahead to What Packages?. Most people would want something beyond a command line, so we should try getting a graphical interface. The package we want is xorg, so, as root, type apt-get install xorg. X will prove to be very useful - it is the package that allows you to draw things on the screen besides text. After grabbing the packages, the installation process will ask you to pick your resolutions - don't forget to use the spacebar to select or deselect any option.

Next, we want something to draw - a desktop environment. There are three main selections here: KDE, GNOME, or XFCE. If you're not sure which to choose, then I prefer GNOME, and this is what is installed by default, although they're all perfectly usable. Going into the differences between them is way beyond If you want to use GNOME, type apt-get install gnome-core gdm. This installs the very basics of GNOME - you can install more of the GNOME components by typing apt-get install gnome gdm instead. Similarly, you can use apt to install kde or kde-core along with kdm. If you're using XFCE, then you'll want gdm and xfce4. Next, you'll be asked which window manager you want to use. Just select the one you just installed, whether it is kdm or gdm. You may also be asked some more questions, depending on what you installed - it should be fairly easy to answer the questions since the spiel beforehand is often very useful. If in doubt, use the defaults.

If you want to reconfigure a package i.e. get asked the same questions when you installed the package the first time round, then, as root, type the command dpkg-reconfigure packagename.

Finally, we want to start up our new graphical interface - type /etc/init.d/gdm start or /etc/init.d/kdm start, and you should be presented with a logon screen. Type in your username and password, and you should be flying! You can use the terminal to install more applications - see the next page for a list of just some of the thousands of packages you can install.