LinuxDevCenter.com
oreilly.comSafari Books Online.Conferences.

advertisement


Red Hat and Debian GNU/Linux Package Managers
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9

dpkg

dpkg [options] action

A tool for installing, managing, and building packages. Serves as a frontend to dpkg-deb.

dpkg actions

These actions are carried out by dpkg itself:

-i pkgfile, --install pkgfile

Install the package specified as pkgfile. With -R or --recursive, pkgfile must be a directory.

--unpack pkgfile

Unpack the package, but don't configure it. With -R or --recursive, pkgfile must be a directory.

--configure [packages|-a|--pending]

Reconfigure one or more unpacked packages. If -a or --pending is given instead of packages, configure all packages that are unpacked but not configured.

-r, --remove [packages|-a|--pending]
--purge [packages|-a|--pending]

Remove or purge one or more installed packages. Removal gets rid of everything except the configuration files listed in debian/conffiles; purging also removes the configuration files. If -a or --pending is given instead of packages, dpkg removes or purges all packages that are unpacked and marked (in /var/lib/dpkg/status) for removing or purging.

--print-avail package

Print the details about package from /var/lib/dpkg/available.

--update-avail pkgs-file
--merge-avail pkgs-file

Update the record of available files kept in /var/lib/dpkg/available. This information is used by dpkg and dselect to determine what packages are available. Update will replace the information with the contents of the pkgs-file, distributed as Packages. Merge combines the information from Packages with the existing information.

-A pkgfile, --record-avail pkgfile

Update the record of available files kept in /var/lib/dpkg/available with information from pkgfile. This information is used by dpkg and dselect to determine what packages are available. With -R or --recursive, pkgfile must be a directory.

--forget-old-unavail

Forget about uninstalled unavailable packages.

--clear-avail

Remove existing information about what packages are available.

-l, --list [pkg-name-pattern]

List all packages whose names match the specified pattern. With no pattern, list all packages in /var/lib/dpkg/available. The pattern can include standard shell wildcard characters and may have to be quoted to prevent the shell from doing filename expansion.

-s packages, --status packages

Report the status of one or more packages by displaying the entry in the status database /var/lib/dpkg/status.

-C, --audit

Search for partially installed packages and suggest how to get them working.

--get-selections [pattern]

Get list of package selections and write to standard output. With pattern specified, write selections that match the pattern.

--set-selections

Set package selections based on input file read from standard input.

--yet-to-unpack

Search for uninstalled packages that have been selected for installation.

-L packages, --listfiles packages

List installed files that came from the specified package or packages.

-S filename-pattern, --search filename-pattern

Search installed packages for a filename. The pattern can include standard shell wildcard characters and may have to be quoted to prevent the shell from doing filename expansion.

--print-architecture

Print target architecture.

--print-gnu-build-architecture

Print the GNU version of the target architecture.

--print-installation-architecture

Print host architecture for installation.

--compare-versions ver1 op ver2

Perform a binary comparison of two version numbers. The operators lt le eq ne ge gt treat a missing version as earlier. The operators lt-nl le-nl ge-nl gt-nl treat a missing version as later (where nl is "not later"). There is a third set of operators (< << <= = >= >> >) that is provided for compatibility with control-file syntax. dpkg returns zero for success (i.e., the condition is satisfied) and nonzero otherwise.

--help

Print help message and exit.

--force-help

Print help message about the --force-list options and exit.

-Dh, --debug=help

Print debugging help message and exit.

--license

Print dpkg license information and exit. Accepts the spelling --licence in addition to --license.

--version

Print dpkg version information and exit.

dpkg-deb actions

The following actions can be specified for dpkg and are passed to dpkg-deb for execution. Also see dpkg-deb.

-b dir [archive], --build dir [archive]

Build a package.

-c archive, --contents archive

List the contents of a package.

-e, --control archive dir

Extract control information from a package.

-f archive [control-fields], --field archive [control-fields]

Display the control field or fields of a package.

-I archive [control-files], --info archive [control-files]

Show information about a package.

--fsys-tarfile archive

Display the filesystem tar- file contained by a package.

-x archive dir, --extract archive dir

Extract the files from a package.

-X archive dir, --vextract archive dir

Extract and display the filenames from a package.

Options

--abort-after=num

Abort processing after num errors. Default is 50.

-B, --auto-deconfigure

When a package is removed, automatically deconfigure any other package that depended on it.

-Doctal, --debug=octal

Turn on debugging, with the octal value specifying the desired level of debugging information. Use -Dh or --debug=help to display the possible values. You can OR the values to get the desired output.

-E, --skip-same-version

Don't install the package if this version is already installed.

--force-list, --no-force-list, --refuse-list

Force or refuse to force an operation. list is specified as a comma-separated item of options. With --force, a warning is printed, but processing continues. --refuse and --no-force cause processing to stop with an error. The force/refuse options are:

architecture

Process even if intended for a different architecture.

auto-select

Select or deselect packages to install or remove them. Forced by default.

bad-path

Some programs are missing from the path.

configure-any

Configure any unconfigured package that the package depends on.

conflicts

Permit installation of conflicting packages. Can result in problems from files being overwritten.

depends

Turn dependency problems into warnings.

depends-version

Warn of version problems when checking dependencies, but otherwise ignore.

downgrade

Install even if a newer version is already installed. Forced by default.

hold

Process packages even if they are marked to be held.

not-root

Try to install or remove even when not logged on as root.

overwrite

overwrite-dir

Overwrite one package's directory with a file from another package.

overwrite-diverted

Overwrite a diverted file with an undiverted version.

remove-essential

Remove an essential package. Note that this can cause your system to stop working.

remove-reinstreq

Remove packages that are broken and are marked to require reinstallation.

-G

Don't install a package if a newer version is already installed. The same as --refuse-downgrade.

--ignore-depends=pkglist

Dependency problems result only in a warning for the packages in pkglist.

--largemem

Specify that dpkg can use as much memory as it needs.

--new

New binary package format. This is a dpkg-deb option.

--no-act

Go through the motions, but don't actually write any changes. Used for testing. Be sure to specify before the action; otherwise changes might be written.

--nocheck

Ignore the contents of the control file when building a package. This is a dpkg-deb option.

-O, --selected-only

Process only packages that are marked as selected for installation.

--old

Old binary package format. This is a dpkg-deb option.

-R, --recursive

Recursively handle .deb files found in the directories specified with -A, --install, --unpack, and --avail and their subdirectories.

-R, --root=dir, --admindir=dir, --instdir=dir

Change default directories. admindir contains administrative files with status and other information about packages; it defaults to /var/lib/dpkg. instdir is the directory in which packages are installed and defaults to /. Changing the root directory to dir automatically changes instdir to dir and admindir to /dir/var/lib/dpkg.

--smallmem

Specify that dpkg should try to preserve memory.

dpkg-deb

dpkg-deb action [options]

Backend command for building and managing Debian package archives. Also see dpkg; you'll often want to use dpkg to pass commands through to dpkg-deb, rather than call dpkg-deb directly.

Actions

-b dir [archive], --build dir [archive]

Create an archive from the filesystem tree starting with directory dir. The directory must have a DEBIAN subdirectory containing the control file and any other control information. If archive is specified and is a filename, the package is written to that file; if no archive is specified, the package is written to dir.deb. If the archive already exists, it is replaced. If archive is the name of a directory, the dpkg-deb looks in the control file for the information it needs to generate the package name. (Note that for this reason, you cannot use --no-check with a directory name.)

-c archive, --contents archive

List the filesystem-tree portion of archive.

-e, --control archive dir

Extract control information from archive into the directory dir, which is created if it doesn't exist.

-f archive [control-fields], --field archive [control-fields]

Extract information about one or more fields in the control file for archive. If no fields are provided, print the entire control file.

-h, --help

Print help information and exit.

-I archive [control-files], --info archive [control-files]

Provide information about binary package archive. If no control files are provided, print a summary of the package contents; otherwise, print the control files in the order they were specified. An error message is printed to standard error for any missing components.

--fsys-tarfile archive

Extract the filesystem tree from archive, and send it to standard output in tar format. Can be used with tar to extract individual files from an archive.

--license

Print the license information and exit. Accepts the spelling --licence in addition to --license.

--version

Print the version number and exit.

-x archive dir, --extract archive dir
-X archive dir, --vextract archive dir

Extract the filesystem tree from archive into the specified directory, creating dir if it doesn't already exist. -x (--extract) works silently, while -X (--vextract) lists the files as it extracts them. Do not use this option to install packages; use dpkg instead.

Options

-D

Turn on debugging.

--new

Build a new-style archive format (this is the default).

--no-check

Don't check the control file before building an archive. This lets you build a broken archive.

--old

Build an old-style archive format.

dpkg-split

dpkg-split [action] [options]

Split a binary package into smaller pieces and reassemble the pieces, manually or in automatic mode. The automatic mode maintains a queue of parts for reassembling. Useful for transferring to and from floppy disks.

Actions

-a -o output part, --auto -o output part

Add part to the queue for automatic reassembly and if all the parts are available, reassemble the package as output.

-d [packages], --discard [packages]

Discard parts from the automatic-assembly queue. If any packages are specified, discard only parts from those packages. Otherwise, empty the queue.

-I parts, --info parts

Print information about the part file or files specified.

-j parts, --join parts

Join the parts of a package file together from the parts specified. The default output file is package-version.deb.

-l, --listq

List the contents of the queue of parts waiting for reassembly, giving the package name, the parts that are on the queue, and the number of bytes.

-s full-package [prefix], --full-package [prefix]

Split the package full-package into parts, named prefixNofM.deb. The prefix defaults to the full-package name without the .deb extension.

-h, --help

Print help message and exit.

--license

Print the license information and exit. Accepts the spelling --licence in addition to --license.

--version

Print the version information and exit.

Options

--depotdir

Specify an alternate directory depotdir for the queue of parts waiting for reassembly. Default is /var/lib/dpkg.

--msdos

Force --split output filenames to be MS-DOS-compatible.

-Q, --npquiet

Do not print an error message for a part that doesn't belong to a binary package when doing automatic queuing or reassembly.

-o output, --output output

Use output as the filename for a reassembled package.

-S num, --partsize num

When splitting, specify the maximum part size (num) in kilobytes. Default is 450 KB.

dselect

dselect [options] [action]

A screen-oriented user frontend to dpkg. The primary user interface for installing and managing packages. See dpkg and dpkg-deb for information on building packages.

Actions

If dselect is run with no action specified on the command line, it displays the following menu:

* 0. [A]ccess      Choose the access method to use.                           
  1. [U]pdate      Update list of available packages, if possible.
  2. [S]elect      Request which packages you want on your system.
  3. [I]nstall     Install and upgrade wanted packages.
  4. [C]onfig      Configure any packages that are unconfigured.
  5. [R]emove      Remove unwanted software.
  6. [Q]uit        Quit dselect.
The asterisk (on the first line here) shows the currently selected option. Any of the menu items can be specified directly on the command line as an action (access, update, select, install, config, remove, quit) to go directly to the desired activity. For example:
% dselect access

If you enter quit on the command line, dselect exits immediately without doing anything. An additional command-line action is menu, which displays the menu and is equivalent to omitting the action.

Options

--admindir dir

Change the directory that holds internal data files to dir. Default is /var/lib/dpkg.

-D [file], --debug [file]

Turn on debugging. Send output to file if specified.

--help

Print help message and exit.

--license

Print the license information and exit. Accepts the spelling --licence in addition to --license.

--version

Print version information and exit.


Return to the Linux DevCenter

 




Linux Online Certification

Linux/Unix System Administration Certificate Series
Linux/Unix System Administration Certificate Series — This course series targets both beginning and intermediate Linux/Unix users who want to acquire advanced system administration skills, and to back those skills up with a Certificate from the University of Illinois Office of Continuing Education.

Enroll today!


Linux Resources
  • Linux Online
  • The Linux FAQ
  • linux.java.net
  • Linux Kernel Archives
  • Kernel Traffic
  • DistroWatch.com


  • Sponsored by: