[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ next ]
There are some front-end programs for the APT system that make it significantly easier to get listings of packages that are available for installation or are already installed, as well as to find out what section a package is in, what its priority is, what its description is, etc.
But... our goal here is to learn how to use pure APT. So how can you find out the name of a package that you want to install?
We have a number of resources for such a task. We'll begin with apt-cache. This program is used by the APT system for maintaining its database. We'll take just a brief look at some of its more practical applications.
For example, suppose that you want to reminisce about the good old days of the Atari 2600. You want to use APT to install an Atari emulator, and then download some games. You can do:
# apt-cache search atari atari-fdisk-cross - Partition editor for Atari (running on non-Atari) circuslinux - The clowns are trying to pop balloons to score points! madbomber - A Kaboom! clone tcs - Character set translator. atari800 - Atari emulator for svgalib/X/curses stella - Atari 2600 Emulator for X windows xmess-x - X binaries for Multi-Emulator Super System
We find several packages related to what we're looking for, together with brief descriptions. To get more information about a specific package, I can then use:
# apt-cache show stella Package: stella Priority: extra Section: non-free/otherosfs Installed-Size: 830 Maintainer: Tom Lear <tom@trap.mtview.ca.us> Architecture: i386 Version: 1.1-2 Depends: libc6 (>= 2.1), libstdc++2.10, xlib6g (>= 3.3.5-1) Filename: dists/potato/non-free/binary-i386/otherosfs/stella_1.1-2.deb Size: 483430 MD5sum: 11b3e86a41a60fa1c4b334dd96c1d4b5 Description: Atari 2600 Emulator for X windows Stella is a portable emulator of the old Atari 2600 video-game console written in C++. You can play most Atari 2600 games with it. The latest news, code and binaries for Stella can be found at: http://www4.ncsu.edu/~bwmott/2600
In this output you have many details about the package that you want (or don't want) to install, together with the full description of the package. If the package is already installed on your system and there is a newer version, you'll see information about both versions. For example:
# apt-cache show lilo Package: lilo Priority: important Section: base Installed-Size: 271 Maintainer: Russell Coker <russell@coker.com.au> Architecture: i386 Version: 1:21.7-3 Depends: libc6 (>= 2.2.1-2), debconf (>=0.2.26), logrotate Suggests: lilo-doc Conflicts: manpages (<<1.29-3) Filename: pool/main/l/lilo/lilo_21.7-3_i386.deb Size: 143052 MD5sum: 63fe29b5317fe34ed8ec3ae955f8270e Description: LInux LOader - The Classic OS loader can load Linux and others This Package contains lilo (the installer) and boot-record-images to install Linux, OS/2, DOS and generic Boot Sectors of other OSes. . You can use Lilo to manage your Master Boot Record (with a simple text screen) or call Lilo from other Boot-Loaders to jump-start the Linux kernel. Package: lilo Status: install ok installed Priority: important Section: base Installed-Size: 190 Maintainer: Vincent Renardias <vincent@debian.org> Version: 1:21.4.3-2 Depends: libc6 (>= 2.1.2) Recommends: mbr Suggests: lilo-doc Description: LInux LOader - The Classic OS loader can load Linux and others This Package contains lilo (the installer) and boot-record-images to install Linux, OS/2, DOS and generic Boot Sectors of other OSes. . You can use Lilo to manage your Master Boot Record (with a simple text screen) or call Lilo from other Boot-Loaders to jump-start the Linux kernel.
Note that the first in the list is the available package and the second is the one already installed. For more general information about a package, you can use:
# apt-cache showpkg penguin-command Package: penguin-command Versions: 1.4.5-1(/var/lib/apt/lists/download.sourceforge.net_debian_dists_unstable_main_binary-i386_Packages)(/var/lib/dpkg/status) Reverse Depends: Dependencies: 1.4.5-1 - libc6 (2 2.2.1-2) libpng2 (0 (null)) libsdl-mixer1.1 (2 1.1.0) libsdl1.1 (0 (null)) zlib1g (2 1:1.1.3) Provides: 1.4.5-1 - Reverse Provides:
And to just find out what packages it depends on:
# apt-cache depends penguin-command penguin-command Depends: libc6 Depends: libpng2 Depends: libsdl-mixer1.1 Depends: libsdl1.1 Depends: zlib1g
In summary, we have a range of weapons we can use to find out the name of a package we want.
One of the ways to locate the name of a package is to know the name of an important file found within the package. For example, to find the package that provides a particular ".h" file you need for compilation you can run:
# dpkg -S stdio.h libc6-dev: /usr/include/stdio.h libc6-dev: /usr/include/bits/stdio.h perl: /usr/lib/perl/5.6.0/CORE/nostdio.h
or:
# dpkg -S /usr/include/stdio.h libc6-dev: /usr/include/stdio.h
To find out the names of packages installed on your system, which is useful, for example, if you plan to clean up your hard drive, you can run:
# dpkg -l | grep mozilla ii mozilla-browse 0.9.6-7 Mozilla Web Browser
The problem with this command is that it can "break" the package name. In the example above, the full name of the package is mozilla-browser. To fix this, you can use the COLUMNS environment variable this way:
[kov]@[couve] $ COLUMNS=132 dpkg -l | grep mozilla ii mozilla-browser 0.9.6-7 Mozilla Web Browser - core and browser
or the description or part of it this way:
# apt-cache search "Mozilla Web Browser" mozilla-browser - Mozilla Web Browser
You're compiling a program and, all of a sudden, boom! There's an error
because it needs a .h file you don't have. The program
auto-apt
can save you from such scenarios. It asks you to install
packages if they're needed, stopping the relevant process and continuing once
the package is installed.
What you do, basically, is run:
# auto-apt run command
Where `command' is the command to be executed that may need some unavailable file. For example:
# auto-apt run ./configure
It will then ask to install the needed packages and call apt-get automatically. If you're running X, a graphical interface will replace the default text interface.
Auto-apt keeps databases which need to be kept up-to-date in order for it to be effective. This is achieved by calling the commands auto-apt update, auto-apt updatedb and auto-apt update-local.
If you want to install a package, and you can't find out what it is called by
searching with apt-cache
, but know the filename of the program
itself, or some other filename that belongs to the package, then you can use
apt-file
to find the package name. This is done like this:
$ apt-file search filename
It works just like dpkg -S, but will also show you uninstalled
packages that contain the file. It could also be used to find what packages
contain necessary include files that are missing when compiling programs,
although auto-apt
is a much better method of solving such issues,
see How to install packages "on demand",
Section 5.3.
You can also list the contents of a package, by running:
$ apt-file list packagename
apt-file
keeps a database of which files all packages contain,
just like auto-apt does and it needs to be up-to-date. This is done by
running:
# apt-file update
By default, apt-file
uses the same database auto-apt
is using, see How to install packages "on
demand", Section 5.3.
Every package installs in its documentation directory (/usr/share/doc/packagename) a file called changelog.Debian.gz which contains the list of changes made to the package since the last version. You can read these files with zless' help, for example, but it is something not so easy, after an complete system upgrade, to start searching changelogs for every upgraded package.
There's a way to automatize this task by means of a tool called
apt-listchanges
. To begin with one needs to install the
apt-listchanges
package. During the package installation, Debconf
will configure it. Some questions may not be shown to you depending on the
priority you set up Debconf to use. Answer to the questions as you want.
The first question asks how you want the changes to be showed by
apt-listchanges. You can have them mailed to you, which is good for automatic
upgrades, or you can ask them in a pager like less
, so you can
inspect the changes before leting the upgrade continue. If you don't want
apt-listchanges
running automaticaly during upgrades you can
answer none.
After apt-listchanges is installed, as soon as packages are downloaded (or gotten from a CD or mounted disk) by apt it will show the lists of changes made to those packages before installing them.
[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ next ]
APT HOWTO (Obsolete Documentation)
1.8.11 - August 2005kov@debian.org