dpkg(1)

Från Wiki.linux.se
Version från den 8 mars 2025 kl. 06.59 av Admin (diskussion | bidrag) (Skapade sidan med '== dpkg(1) - Linux manual page == === NAME === '''dpkg''' - package manager for Debian === SYNOPSIS === <code>dpkg [option...] action</code> === WARNING === This manual is intended for users wishing to understand '''dpkg'''’s command line options and package states in more detail than provided by <code>dpkg --help</code>. It should '''not''' be used by package maintainers wishing to understand how '''dpkg''' will install their packages. The descriptions of what '''...')
(skillnad) ← Äldre version | Nuvarande version (skillnad) | Nyare version → (skillnad)
Hoppa till navigering Hoppa till sök

dpkg(1) - Linux manual page

NAME

dpkg - package manager for Debian

SYNOPSIS

dpkg [option...] action

WARNING

This manual is intended for users wishing to understand dpkg’s command line options and package states in more detail than provided by dpkg --help.

It should not be used by package maintainers wishing to understand how dpkg will install their packages. The descriptions of what dpkg does when installing and removing packages are particularly inadequate.

DESCRIPTION

dpkg is a medium-level tool to install, build, remove and manage Debian packages. The primary and more user-friendly front-end for dpkg as a CLI (command-line interface) is apt(8) and as a TUI (terminal user interface) is aptitude(8). dpkg itself is controlled entirely via command line parameters, which consist of exactly one action and zero or more options. The action parameter tells dpkg what to do, and options control the behavior of the action in some way.

dpkg can also be used as a front-end to dpkg-deb(1) and dpkg-query(1). The list of supported actions can be found later in the ACTIONS section. If any such action is encountered, dpkg just runs dpkg-deb or dpkg-query with the parameters given to it, but no specific options are currently passed to them.

INFORMATION ABOUT PACKAGES

dpkg maintains some usable information about available packages. The information is divided into three classes: states, selection states, and flags. These values are intended to be changed mainly with dselect.

Package states

  • not-installed - The package is not installed on your system.
  • config-files - Only the configuration files or the postrm script and the data it needs to remove of the package exist on the system.
  • half-installed - The installation of the package has been started, but not completed for some reason.
  • unpacked - The package is unpacked but not configured.
  • half-configured - The package is unpacked, and configuration has been started but not yet completed.
  • triggers-awaited - The package awaits trigger processing by another package.
  • triggers-pending - The package has been triggered.
  • installed - The package is correctly unpacked and configured.

Package selection states

  • install - The package is selected for installation.
  • hold - A package marked to be on hold is kept on the same version; no automatic new installs, upgrades, or removals will be performed.
  • deinstall - The package is selected for deinstallation (removing all files except configuration files).
  • purge - The package is selected to be purged (removing everything, including configuration files).
  • unknown - The package selection is unknown.

Package flags

  • ok - A package marked ok is in a known state, but might need further processing.
  • reinstreq - A package marked reinstreq is broken and requires reinstallation.

ACTIONS

  • -i, --install package-file... - Install the package.
  • --unpack package-file... - Unpack the package but don’t configure it.
  • --configure package...|-a|--pending - Configure a package that has been unpacked but not yet configured.
  • --triggers-only package...|-a|--pending - Process only triggers.
  • -r, --remove package...|-a|--pending - Remove an installed package but keep configuration files.
  • -P, --purge package...|-a|--pending - Purge an installed or already removed package.
  • -V, --verify [package-name...] - Verify package integrity.
  • -C, --audit [package-name...] - Perform database sanity and consistency checks.
  • --update-avail [Packages-file] - Update dpkg's and dselect’s idea of available packages.
  • --set-selections - Set package selections.
  • --clear-selections - Clear the requested state of every non-essential package.

OPTIONS

  • --force-thing - Force an action even if a sanity check would otherwise prohibit it.
  • --force-all - Turn on all force options.
  • --ignore-depends=package,... - Ignore dependency-checking for specified packages.
  • --no-act, --dry-run, --simulate - Simulate an action without making changes.
  • -R, --recursive - Recursively handle all regular files matching pattern *.deb.
  • --log=filename - Log status changes and actions to the specified filename.
  • --no-triggers - Do not run any triggers in this run.

EXIT STATUS

  • 0 - The requested action was successfully performed.
  • 1 - A check or assertion command returned false.
  • 2 - Fatal or unrecoverable error due to invalid command-line usage.

ENVIRONMENT

  • PATH - This variable should point to the system paths where required programs are found.
  • HOME - If set, dpkg will use it as the directory to read the user-specific configuration file.
  • TMPDIR - If set, dpkg will use it to create temporary files and directories.
  • SHELL - The program dpkg will execute when starting a new interactive shell.
  • DPKG_COLORS - Sets the color mode (auto, always, or never).

FILES

  • /usr/local/etc/dpkg/dpkg.cfg - Configuration file with default options.
  • /usr/local/var/lib/dpkg/status - Statuses of available packages.
  • /usr/local/var/lib/dpkg/available - List of available packages.

SECURITY

Any operation that needs write access to the database or the filesystem is considered a privileged operation that might allow root escalation. These operations must never be delegated to an untrusted user or be done on untrusted packages.

BUGS

  • --no-act usually gives less information than might be helpful.

SEE ALSO

COLOPHON

This page is part of the dpkg (Debian Package Manager) project. For more information, visit https://wiki.debian.org/Teams/Dpkg/. If you have a bug report, see http://bugs.debian.org/cgi-bin/pkgreport.cgi?src=dpkg.

Sidslut

Orginalhemsidan på Engelska :https://man7.org/linux/man-pages/man1/dpkg.1.html


Det här är en maskinöversättning av Linux man sidor till svenska. Om du hittar fel är vi tacksamma om du rapporterar dem via formuläret som finns på https://www.linux.se/kontaka-linux-se/

Tack till PC Service som har sponsrat Linux.se med webbhotell.