man > dpkg-divert(1)

๐Ÿ“› NAME

dpkg-divert โ€” override a package's version of a file

๐Ÿš€ Quick Reference

Use CaseCommandDescription
๐Ÿ“‹ List all diversionsdpkg-divert --listShow all file diversions on the system
โž• Add diversiondpkg-divert --divert /path/to/diverted --rename /path/to/fileDivert a file to a new location, renaming it
โž– Remove diversiondpkg-divert --rename --remove /path/to/fileRemove a diversion and restore original file
๐Ÿ“ฆ Divert for specific packagedpkg-divert --package pkgname --divert /path/to/diverted --rename /path/to/fileDivert file for all packages except specified one
๐Ÿ” Find diverting packagedpkg-divert --listpackage /path/to/fileShow which package diverts a file
๐Ÿท๏ธ Get real filenamedpkg-divert --truename /path/to/filePrint the real name for a diverted file

๐Ÿ“– Synopsis

dpkg-divert [option...] command

๐Ÿ“ Description

dpkg-divert is the utility used to set up and update the list of diversions.

File diversions are a way of forcing dpkg(1) not to install a file into its location, but to a diverted location. Diversions can be used through the Debian package scripts to move a file away when it causes a conflict. System administrators can also use it to override some package's configuration file, or whenever some files (which aren't marked as "conffiles") need to be preserved by dpkg, when installing a newer version of a package which contains those files.

โš™๏ธ Commands

๐Ÿ”ง Options

๐Ÿšช Exit Codes

๐ŸŒ Environment

๐Ÿ“ Files

๐Ÿ“Œ Notes

๐Ÿ’ก Examples

To divert all copies of /usr/bin/example to /usr/bin/example.foo, directing all packages providing it to install as /usr/bin/example.foo, performing the rename if required:

dpkg-divert --divert /usr/bin/example.foo --rename /usr/bin/example

To remove that diversion:

dpkg-divert --rename --remove /usr/bin/example

To divert any package trying to install /usr/bin/example to /usr/bin/example.foo, except your own wibble package:

dpkg-divert --package wibble --divert /usr/bin/example.foo \
   --rename /usr/bin/example

To remove that diversion:

dpkg-divert --package wibble --rename --remove /usr/bin/example

๐Ÿ”— See Also

dpkg(1)

dpkg-divert(1)
๐Ÿ“› NAME ๐Ÿš€ Quick Reference ๐Ÿ“– Synopsis ๐Ÿ“ Description โš™๏ธ Commands ๐Ÿ”ง Options ๐Ÿšช Exit Codes ๐ŸŒ Environment ๐Ÿ“ Files ๐Ÿ“Œ Notes ๐Ÿ’ก Examples ๐Ÿ”— See Also

Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-04 07:44 @216.73.217.109
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!

^_top_^