don’t specify a pattern, all packages will be
listed:
# dpkg -l xdm ii xdm 3.3.2.3a-11 X display manager
Example 8
Use dpkg -S to determine the package from
which a particular file was installed with the filename :
# dpkg -S /usr/bin/nl textutils: /usr/bin/nl
Name
apt-get
Syntax
apt-get [
options
] [
command
] [
package_name
...]
Description
The apt-get command is part of theAdvanced Package Tool (APT) management system. It does
not work directly with .deb files like dpkg , but uses package names instead. apt-get maintains a database of package
information that enables the tool to automatically upgrade packages
and their dependencies as new package releases become
available.
Frequently used options
-d
Download files, but do not install. This is useful when
you wish to get a large number of package files but delay
their installation to prevent installation errors from
stopping the download process.
-s
Simulate the steps in a package change, but do not
actually change the system.
-y
Automatically respond “yes” to all prompts, instead of
prompting you for a response during package
installation/removal.
Frequently used commands
dist-upgrade
Upgrade automatically to new versions of Debian
Linux.
install
Install or upgrade one or more packages by name.
remove
Remove specified packages.
update
Fetch a list of currently available packages. This is
typically done before any changes are made to existing
packages.
upgrade
Upgrade a system’s complete set of packages to current
versions safely. This command is conservative and will not
process upgrades that could cause a conflict or break an
existing configuration; it also will not remove
packages.
Additional commands and options are available. See the apt-get manpage for more information.
apt-get uses /etc/apt/sources.list to determine where
packages should be obtained. The file should contain one or more
lines that look something like this:
deb http://http.us.debian.org/debian stable main contrib non-free
Example
Remove the elvis package using apt-get :
# apt-get remove elvis Reading Package Lists... Done
Building Dependency Tree... Done
The following packages will be REMOVED:
elvis
0 packages upgraded, 0 newly installed, 1 to remove
and 376 not upgraded.
Need to get 0B of archives. After unpacking 1363kB
will be freed.
Do you want to continue? [Y/n] y (Reading database ... 54816 files and directories
currently installed.)
Removing elvis ...
(removal continues...)
In this example, the user is required to respond with y when prompted to continue.
Using the -y option to apt-get would eliminate this
interaction.
Name
dselect
Syntax
dselect
Description
dselect is an interactive,
menu-driven, frontend tool for dpkg and is
usually invoked without parameters. The dselect command lets you interactively manage packages by selecting them for
installation, removal, configuration, and so forth. Selections are
made from a locally stored list of available packages, which may be
updated while running dselect . Package actions
initiated by dselect are carried out using dpkg .
Name
alien
Syntax
alien [--to-deb] [--patch=
patchfile
] [
options
]
file
Description
Convert to or install a non-Debian (or “alien”)
package. Supported package types include Red Hat .rpm , Stampede .slp ,
Slackware .tgz , and generic .tar.gz files.
rpm
must also be installed on the system
to convert an RPM package into a .deb package.
The alien command produces an output
package in Debian format by default after
conversion.
Frequently used options
-i
Automatically install the output package and remove the
converted package file.
-r
Convert package to RPM format.
-t
Convert package to a
gzip
tar
archive.
Example
Install a non-Debian package on a Debian system using alien with the -i option:
# alien -i package.rpm
On the Exam
dselect, apt-get , and alien are important parts of Debian package
management, but
Dean Wesley Smith, Kristine Kathryn Rusch
Martin A. Lee, Bruce Shlain