Datasheet

85
Chapter 4 Software Management
Installing Packages
Now that you know how to find packages, you likely want to install some. I’ll use
several example packages, one for each tool available. First, if you aren’t logged in
as
root (and you shouldn’t be), do so now. You can either switch to a different con-
sole with
Ctrl+Alt+Fn, where n is a number from 1 (the first console) through 6
(
Ctrl+Alt+F7 is reserved for X Windows). Alternatively, you can use the su com-
mand, as in the following:
user@hostname:~$ su
Password:
hostname:~#
su
means “super user,” and it allows you to switch to the root account from a regu-
lar user account. The password you type is the
root password, which you initially
configured during the installation. Note the prompt change; the terminator is now
a pound sign (
#) instead of a dollar sign, indicating that you’re logged in as root.
Since you know you’re logged in as
root from the pound sign, the prompt doesn’t
include the username at the beginning.
Installing packages using apt-get
The simplest is usually the best way to start, so let’s start with apt-get. While I
recommend
aptitude for regular use (due mainly to its ability to track automati-
cally installed packages), you can’t beat
apt-get as a learning tool. First and fore-
most, before you install any new packages or upgrade old packages with
apt-get,
you need to run
apt-get update, as shown in the following code example. This
downloads the latest list of packages from Debian servers, and it ensures that you
get the latest versions of packages available for the Debian tree you have installed:
hostname:~# apt-get update
Hit http://ftp.us.debian.org stable/main Packages
Hit http://ftp.us.debian.org stable/main Release
Hit http://ftp.us.debian.org stable/main Sources
Hit http://ftp.us.debian.org stable/main Release
Get:1 http://security.debian.org stable/updates/main Packages
[183kB]
Hit http://non-us.debian.org stable/non-US/main Packages
Hit http://non-us.debian.org stable/non-US/main Release
Hit http://non-us.debian.org stable/non-US/main Sources
Hit http://non-us.debian.org stable/non-US/main Release
Get:2 http://security.debian.org stable/updates/main Release
[110B]
Fetched 183kB in 2s (85.7kB/s)
Reading Package Lists... Done
Building Dependency Tree... Done
user@hostname:~$
09_576445 ch04.qxd 7/5/05 3:10 PM Page 85