1dpkg-divert(1)                    dpkg suite                    dpkg-divert(1)
2
3
4

NAME

6       dpkg-divert - override a package's version of a file
7

SYNOPSIS

9       dpkg-divert [option...]  command
10

DESCRIPTION

12       dpkg-divert  is  the  utility  used  to  set  up and update the list of
13       diversions.
14
15       File diversions are a way of forcing dpkg(1) not to install a file into
16       its  location,  but  to  a  diverted  location.  Diversions can be used
17       through the Debian package scripts to move a file away when it causes a
18       conflict.  System  administrators  can  also  use  it  to override some
19       package's configuration file, or  whenever  some  files  (which  aren't
20       marked  as “conffiles”) need to be preserved by dpkg, when installing a
21       newer version of a package which contains those files.
22
23

COMMANDS

25       [--add] file
26              Add a diversion for file.
27
28       --remove file
29              Remove a diversion for file.
30
31       --list glob-pattern
32              List diversions matching glob-pattern.
33
34       --listpackage file
35              Print the name of the package  that  diverts  file  (since  dpkg
36              1.15.0).   Prints  LOCAL if file is locally diverted and nothing
37              if file is not diverted.
38
39       --truename file
40              Print the real name for a diverted file.
41

OPTIONS

43       --admindir directory
44              Set   the   dpkg   data   directory   to   directory   (default:
45              /var/lib/dpkg).
46
47       --divert divert-to
48              divert-to  is  the  location  where  the  versions  of  file, as
49              provided by other packages, will be diverted.
50
51       --local
52              Specifies that all packages' versions of this file are diverted.
53              This  means,  that there are no exceptions, and whatever package
54              is installed, the file is diverted. This can be used by an admin
55              to install a locally modified version.
56
57       --package package
58              package  is the name of a package whose copy of file will not be
59              diverted. i.e. file will be diverted  for  all  packages  except
60              package.
61
62       --quiet
63              Quiet mode, i.e. no verbose output.
64
65       --rename
66              Actually  move  the file aside (or back). dpkg-divert will abort
67              operation in case the destination file already exists.
68
69       --test Test  mode,  i.e.  don't  actually  perform  any  changes,  just
70              demonstrate.
71
72       -?, --help
73              Show the usage message and exit.
74
75       --version
76              Show the version and exit.
77

EXIT STATUS

79       0      The requested action was successfully performed.
80
81       2      Fatal  or unrecoverable error due to invalid command-line usage,
82              or interactions  with  the  system,  such  as  accesses  to  the
83              database, memory allocations, etc.
84

ENVIRONMENT

86       DPKG_ADMINDIR
87              If set and the --admindir option has not been specified, it will
88              be used as the dpkg data directory.
89
90       DPKG_MAINTSCRIPT_PACKAGE
91              If set and the --local  and  --package  options  have  not  been
92              specified, dpkg-divert will use it as the package name.
93

FILES

95       /var/lib/dpkg/diversions
96              File  which  contains  the  current  list  of  diversions of the
97              system. It is located  in  the  dpkg  administration  directory,
98              along  with  other  files  important  to dpkg, such as status or
99              available.
100              Note: dpkg-divert preserves the old  copy  of  this  file,  with
101              extension -old, before replacing it with the new one.
102

NOTES

104       When  adding,  default  is  --local and --divert original.distrib. When
105       removing, --package or --local and --divert must match if specified.
106
107       Directories can't be diverted with dpkg-divert.
108
109       Care should be  taken  when  diverting  shared  libraries,  ldconfig(8)
110       creates  a  symbolic  link based on the DT_SONAME field embedded in the
111       library.  Because ldconfig doesn't honour diverts (only dpkg does), the
112       symlink  may  end  up  pointing  at the diverted library, if a diverted
113       library has the same SONAME as the undiverted one.
114

EXAMPLES

116       To divert all copies of  a  /usr/bin/example  to  /usr/bin/example.foo,
117       i.e.  directs  all packages providing /usr/bin/example to install it as
118       /usr/bin/example.foo, performing the rename if required:
119
120       dpkg-divert --divert /usr/bin/example.foo --rename /usr/bin/example
121
122       To remove that diversion:
123
124       dpkg-divert --rename --remove /usr/bin/example
125
126
127       To  divert  any  package  trying   to   install   /usr/bin/example   to
128       /usr/bin/example.foo, except your own wibble package:
129
130       dpkg-divert  --package  wibble  --divert  /usr/bin/example.foo --rename
131              /usr/bin/example
132
133       To remove that diversion:
134
135       dpkg-divert --package wibble --rename --remove /usr/bin/example
136

SEE ALSO

138       dpkg(1).
139
140
141
1421.18.25                           2018-06-26                    dpkg-divert(1)
Impressum