OS Manuals

/usr/bin/dpkg-divert

The Debian Package Manager

From dpkg 1.23.11-r3 (os), captured 2026-11-05 by running dpkg-divert --help (exit 0). permalink

Usage: dpkg-divert [<option>...] <command>

Commands:
      [--add] <file>
          Add a diversion.
      --remove <file>
          Remove a diversion.
      --list [<glob-pattern>]
          Show file diversions.
      --listpackage <file>
          Show what package diverts the file.
      --truename <file>
          Show the diverted file.
      --help
          Show this help message.
      --version
          Show the version.

Options:
      --package <package>
          Name of the package whose copy of <file> will not be diverted.
      --local
          All packages' versions are diverted.
      --divert <divert-to>
          The name used by other packages' versions.
      --rename
          Move the file aside or back.
      --no-rename
          Do not move the file aside or back (default behavior).
      --test
          Print what would be done, but perform no action.
      --quiet
          Enable quiet mode, minimal output.
      --admindir <directory>
          Change the database directory.
          [default: /var/lib/dpkg]
          [env: DPKG_ADMINDIR=]
      --instdir <directory>
          Change the installation directory.
          [default: /]
      --root <directory>
          Change the root directory.
          [default: /]
          [env: DPKG_ROOT=]

When adding, default is --local and --divert <original>.distrib.
When removing, --package or --local and --divert must match if specified.
Package preinst/postrm scripts should always specify --package and --divert.
Options (16)
OptionDescriptionSource
--remove fileRemove a diversion.help
--list glob-patternShow file diversions.help
--listpackage fileShow what package diverts the file.help
--truename fileShow the diverted file.help
--help, -?Show the usage message and exit.help + man
--versionShow the version and exit.help + man
--package packagepackage is the name of a package whose copy of file will not be diverted.help + man
--localSpecifies that all packages' versions of this file are diverted.help + man
--divert divert-todivert-to is the location where the versions of file, as provided by other packages, will be diverted.help + man
--renameActually move the file aside (or back).help + man
--no-renameSpecifies that the file should not be renamed while adding or removing the diversion into the database.help + man
--testTest mode, i.e. don't actually perform any changes, just demonstrate.help + man
--quietQuiet mode, i.e. no verbose output.help + man
--admindir directorySet the administrative directory to directory.help + man
--instdir directorySet the installation directory, which refers to the directory where packages get installed.help + man
--root directorySet the root directory to directory, which sets the installation directory to «directory» and the administrative directory to «directory/var/lib/dpkg» if DPKG_ROOT has not been set.help + man
Exit status (2) from the manual page
0The requested action was successfully performed.
2Fatal or unrecoverable error due to invalid command-line usage, or interactions with the system, such as accesses to the database, memory allocations, etc.
Examples (4) from the manual page, untested

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.