1 .\" dpkg manual page - dpkg-divert(1)
3 .\" Copyright © 1995 Ian Jackson <ijackson@chiark.greenend.org.uk>
4 .\" Copyright © 1999 Wichert Akkerman <wakkerma@debian.org>
5 .\" Copyright © 2004 Scott James Remnant <keybuk@debian.org>
6 .\" Copyright © 2007-2013, 2015 Guillem Jover <guillem@debian.org>
8 .\" This is free software; you can redistribute it and/or modify
9 .\" it under the terms of the GNU General Public License as published by
10 .\" the Free Software Foundation; either version 2 of the License, or
11 .\" (at your option) any later version.
13 .\" This is distributed in the hope that it will be useful,
14 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
15 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 .\" GNU General Public License for more details.
18 .\" You should have received a copy of the GNU General Public License
19 .\" along with this program. If not, see <https://www.gnu.org/licenses/>.
21 .TH dpkg\-divert 1 "%RELEASE_DATE%" "%VERSION%" "dpkg suite"
24 dpkg\-divert \- override a package's version of a file
33 is the utility used to set up and update the list of diversions.
35 File \fIdiversions\fP are a way of forcing
37 not to install a file into its
38 location, but to a \fIdiverted\fP location. Diversions can be used through the
39 Debian package scripts to move a file away when it causes a conflict. System
40 administrators can also use it to override some package's configuration file,
41 or whenever some files (which aren't marked as “conffiles”) need to be
42 preserved by \fBdpkg\fP, when installing a newer version of a package which
47 .RB [ \-\-add "] \fIfile\fP"
48 Add a diversion for \fIfile\fP.
50 .BI \-\-remove " file"
51 Remove a diversion for \fIfile\fP.
53 .BI \-\-list " glob-pattern"
54 List diversions matching \fIglob-pattern\fP.
56 .BI \-\-listpackage " file"
57 Print the name of the package that diverts \fIfile\fP (since dpkg 1.15.0).
59 \fIfile\fP is locally diverted and nothing if \fIfile\fP is not diverted.
61 .BI \-\-truename " file"
62 Print the real name for a diverted file.
66 .BI \-\-admindir " directory"
67 Set the \fBdpkg\fP data directory to \fIdirectory\fP (default:
70 .BI \-\-divert " divert-to"
71 \fIdivert-to\fP is the location where the versions of \fIfile\fP, as
72 provided by other packages, will be diverted.
75 Specifies that all packages' versions of this file are diverted.
76 This means, that there are no exceptions, and whatever package is installed,
77 the file is diverted. This can be used by an admin to install a locally
80 .BI \-\-package " package"
81 \fIpackage\fP is the name of a package whose copy of \fIfile\fP will not
82 be diverted. i.e. \fIfile\fP will be diverted for all packages except
86 Quiet mode, i.e. no verbose output.
89 Actually move the file aside (or back). \fBdpkg\-divert\fP will abort operation
90 in case the destination file already exists.
93 Test mode, i.e. don't actually perform any changes, just demonstrate.
96 Show the usage message and exit.
99 Show the version and exit.
104 The requested action was successfully performed.
107 Fatal or unrecoverable error due to invalid command-line usage, or
108 interactions with the system, such as accesses to the database,
109 memory allocations, etc.
114 If set and the \fB\-\-admindir\fP option has not been specified, it will
115 be used as the \fBdpkg\fP data directory.
117 .B DPKG_MAINTSCRIPT_PACKAGE
118 If set and the \fB\-\-local\fP and \fB\-\-package\fP options have not been
119 specified, \fBdpkg\-divert\fP will use it as the package name.
123 .I %ADMINDIR%/diversions
124 File which contains the current list of diversions of the system. It is
125 located in the \fBdpkg\fP administration directory, along with other files
126 important to \fBdpkg\fP, such as \fIstatus\fP or \fIavailable\fP.
128 Note: \fBdpkg\-divert\fP preserves the old copy of this file, with extension
129 \fI\-old\fP, before replacing it with the new one.
132 When adding, default is \fB\-\-local\fP and \fB\-\-divert\fP
133 \fIoriginal\fP\fB.distrib\fP. When removing, \fB\-\-package\fP or
134 \fB\-\-local\fP and \fB\-\-divert\fP must match if specified.
136 Directories can't be diverted with \fBdpkg\-divert\fP.
138 Care should be taken when diverting shared libraries, \fBldconfig\fP(8)
139 creates a symbolic link based on the DT_SONAME field embedded in the library.
140 Because \fBldconfig\fP doesn't honour diverts (only \fBdpkg\fP does),
141 the symlink may end up pointing at the diverted library, if a diverted
142 library has the same SONAME as the undiverted one.
145 To divert all copies of a \fI/usr/bin/example\fR to \fI/usr/bin/example.foo\fR,
146 i.e. directs all packages providing \fI/usr/bin/example\fR to install it as
147 \fI/usr/bin/example.foo\fR, performing the rename if required:
149 dpkg\-divert \-\-divert /usr/bin/example.foo \-\-rename /usr/bin/example
151 To remove that diversion:
153 dpkg\-divert \-\-rename \-\-remove /usr/bin/example
156 To divert any package trying to install \fI/usr/bin/example\fR to
157 \fI/usr/bin/example.foo\fR, except your own \fIwibble\fR package:
159 dpkg\-divert \-\-package wibble \-\-divert /usr/bin/example.foo \-\-rename /usr/bin/example
161 To remove that diversion:
163 dpkg\-divert \-\-package wibble \-\-rename \-\-remove /usr/bin/example