APT and aptitude

From SaruWiki
Revision as of 22:15, 22 May 2008 by Saruman! (talk | contribs) (Apt/aptitude page started)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Using APT and Aptitude

Your Debian system can easily be expanded, and also kept up-to-date with the latest security fixes, if you use Debian's beautiful APT (Advanced Packaging Technology) tools. Of all available APT-based tools, we usually use the following:

  • apt-get, the command line utilities that go with APT; or
  • aptitude, a curses-based frontend for APT.

These APT-based tools are incredibly powerful and flexible, but we're not going to explain them fully here (for tuturials and whatnot, go here). What we need to establish now, is how to configure APT, and how to use it.

APT gets its information from a configuration file that can be found in /etc/apt. Of these, the most important is sources.list because it defines what packages and updates can be installed from where, and even what version of Debian we want to maintain. For now let's just suffice to say that in the sources.list, you need to remove the references to the CD-ROm with which you installed the system, and specify which on-line repository you wish to use for installing and updating packages. To this end, open /etc/apt/sources.list with your favourite text editor while you are logged in as root.

References to the CD-ROM look a bit like this:

deb cdrom:[Debian GNU/Linux testing _Etch_ - Official Beta i386 CD Binary-1 20070317-21:45]/ etch contrib main

Disable this line by putting a hash (#) in front of it (you could have more than one line beginning with deb cdrom:).

Now make sure you have a section that references one or more on-line repositories. This could make your sources.list look like this:

# deb cdrom:[Debian GNU/Linux testing _Etch_ - Official Beta i386 CD Binary-1 20070317-21:45]/ etch contrib main

deb ftp://ftp.nl.debian.org/debian/ etch main contrib
deb-src ftp://ftp.nl.debian.org/debian/ etch main contrib

deb http://security.debian.org/ etch/updates main contrib
deb-src http://security.debian.org/ etch/updates main contrib

# deb ftp://ftp.nl.debian.org/debian-volatile etch/volatile main contrib

When you want to update, change, add software, or even remove software, you better update your APT system by running one of the following commands:

  • sudo apt-get update
  • sudo aptitude update
  • sudo aptitude, then press u

Note: if you haven't installed sudo yet, then you can only run the commands as root, and they are then: apt-get update, aptitude update, and aptitude then u.