- Debian Admin - http://www.debianadmin.com -
Replace binaries and Files with dpkg-divert
Posted By Admin On 14th December 2006 @ 09:00 In Package Mgmt | No Comments
If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!
dpkg-divert is the utility used to set up and update the list of diversions. It functions in three basic modes - adding, removing, and listing diversions. The options are –add, –remove, and –list, respectively. Additionally, it can print out the real name for a diverted file. Other options (listed below) may also be specified.
The dpkg-divert command allows you to replace a binary installed upon the system, and have this replacement persist even if you upgrade packages.This is very useful if you want to use an updated version of some application instead of old version existing on your machine.
dpkg-divert Syntax
dpkg-divert [options] [--add] <file>
dpkg-divert [options] --remove <file>
dpkg-divert [options] --list <glob-pattern> dpkg-divert [options] --truename <file>
dpkg-divert Examples
To divert all copies of a /usr/bin/example to /usr/bin/example.foo, i.e. directs all packages providing /usr/bin/example to install it 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
If you want to know more available options for dpkg-divert check man page
Tags: adding divert to package, dpkg divert, dpkg divert debian, dpkg divert examples, dpkg divert ubuntu, Package Mgmt, remove divert packageYou may also be interested in...
Article printed from Debian Admin: http://www.debianadmin.com
URL to article: http://www.debianadmin.com/replace-binaries-and-files-with-dpkg-divert.html
Click here to print.