.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "dpkg-divert 1" .TH dpkg-divert 1 2024-01-19 1.22.3 "dpkg suite" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME dpkg\-divert \- override a package's version of a file .SH SYNOPSIS .IX Header "SYNOPSIS" \&\fBdpkg-divert\fR [\fIoption\fR...] \&\fIcommand\fR .SH DESCRIPTION .IX Header "DESCRIPTION" \&\fBdpkg-divert\fR is the utility used to set up and update the list of diversions. .PP File \fIdiversions\fR are a way of forcing \&\fBdpkg\fR\|(1) not to install a file into its location, but to a \fIdiverted\fR location. Diversions can be used through the package maintainer 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 \(lqconffiles\(rq) need to be preserved by \fBdpkg\fR, when installing a newer version of a package which contains those files. .SH COMMANDS .IX Header "COMMANDS" .IP "[\fB\-\-add\fR] \fIfile\fR" 4 .IX Item "[--add] file" Add a diversion for \fIfile\fR. The file is currently not renamed, see \fB\-\-rename\fR. .IP "\fB\-\-remove\fR \fIfile\fR" 4 .IX Item "--remove file" Remove a diversion for \fIfile\fR. The file is currently not renamed, see \fB\-\-rename\fR. .IP "\fB\-\-list\fR [\fIglob-pattern\fR]" 4 .IX Item "--list [glob-pattern]" List all diversions, or ones matching \fIglob-pattern\fR. .IP "\fB\-\-listpackage\fR \fIfile\fR" 4 .IX Item "--listpackage file" Print the name of the package that diverts \fIfile\fR (since dpkg 1.15.0). Prints LOCAL if \&\fIfile\fR is locally diverted and nothing if \fIfile\fR is not diverted. .IP "\fB\-\-truename\fR \fIfile\fR" 4 .IX Item "--truename file" Print the real name for a diverted file. .SH OPTIONS .IX Header "OPTIONS" .IP "\fB\-\-admindir\fR \fIdirectory\fR" 4 .IX Item "--admindir directory" Set the administrative directory to \fIdirectory\fR. Defaults to \(Fo\fI/var/lib/dpkg\fR\(Fc if \fBDPKG_ADMINDIR\fR has not been set. .IP "\fB\-\-instdir\fR \fIdirectory\fR" 4 .IX Item "--instdir directory" Set the installation directory, which refers to the directory where packages get installed (since dpkg 1.19.2). Defaults to \(Fo\fI/\fR\(Fc if \fBDPKG_ROOT\fR has not been set. .IP "\fB\-\-root\fR \fIdirectory\fR" 4 .IX Item "--root directory" Set the root directory to \fBdirectory\fR, which sets the installation directory to \(Fo\fIdirectory\fR\(Fc and the administrative directory to \(Fo\fIdirectory\fR\fB/var/lib/dpkg\fR\(Fc (since dpkg 1.19.2) if \fBDPKG_ROOT\fR has not been set. .IP "\fB\-\-divert\fR \fIdivert-to\fR" 4 .IX Item "--divert divert-to" \&\fIdivert-to\fR is the location where the versions of \fIfile\fR, as provided by other packages, will be diverted. .IP \fB\-\-local\fR 4 .IX Item "--local" Specifies that all packages' versions of this file are diverted. This means, that there are no exceptions, and whatever package is installed, the file is diverted. This can be used by an admin to install a locally modified version. .IP "\fB\-\-package\fR \fIpackage\fR" 4 .IX Item "--package package" \&\fIpackage\fR is the name of a package whose copy of \fIfile\fR will not be diverted. i.e. \fIfile\fR will be diverted for all packages except \&\fIpackage\fR. .IP \fB\-\-quiet\fR 4 .IX Item "--quiet" Quiet mode, i.e. no verbose output. .IP \fB\-\-rename\fR 4 .IX Item "--rename" Actually move the file aside (or back). \&\fBdpkg-divert\fR will abort operation in case the destination file already exists. This is the common behavior used for diversions of files from the non\-\fBEssential\fR package set (see \fB\-\-no\-rename\fR for more details). .IP \fB\-\-no\-rename\fR 4 .IX Item "--no-rename" Specifies that the file should not be renamed while adding or removing the diversion into the database (since dpkg 1.19.1). This is intended for diversions of files from the \fBEssential\fR package set, where the temporary disappearance of the original file is not acceptable, as it can render the system non-functional. This is the default behavior, but that will change in the dpkg 1.20.x cycle. .IP \fB\-\-test\fR 4 .IX Item "--test" Test mode, i.e. don't actually perform any changes, just demonstrate. .IP "\fB\-?\fR, \fB\-\-help\fR" 4 .IX Item "-?, --help" Show the usage message and exit. .IP \fB\-\-version\fR 4 .IX Item "--version" Show the version and exit. .SH "EXIT STATUS" .IX Header "EXIT STATUS" .IP \fB0\fR 4 .IX Item "0" The requested action was successfully performed. .IP \fB2\fR 4 .IX Item "2" Fatal or unrecoverable error due to invalid command-line usage, or interactions with the system, such as accesses to the database, memory allocations, etc. .SH ENVIRONMENT .IX Header "ENVIRONMENT" .IP \fBDPKG_ROOT\fR 4 .IX Item "DPKG_ROOT" If set and the \fB\-\-instdir\fR or \fB\-\-root\fR options have not been specified, it will be used as the filesystem root directory (since dpkg 1.19.2). .IP \fBDPKG_ADMINDIR\fR 4 .IX Item "DPKG_ADMINDIR" If set and the \fB\-\-admindir\fR or \fB\-\-root\fR options have not been specified, it will be used as the \fBdpkg\fR data directory. .IP \fBDPKG_MAINTSCRIPT_PACKAGE\fR 4 .IX Item "DPKG_MAINTSCRIPT_PACKAGE" If set and the \fB\-\-local\fR and \fB\-\-package\fR options have not been specified, \fBdpkg-divert\fR will use it as the package name. .IP \fBDPKG_DEBUG\fR 4 .IX Item "DPKG_DEBUG" Sets the debug mask (since dpkg 1.21.10) from an octal value. The currently accepted flags are described in the \fBdpkg \-\-debug\fR option, but not all these flags might have an effect on this program. .IP \fBDPKG_COLORS\fR 4 .IX Item "DPKG_COLORS" Sets the color mode (since dpkg 1.18.5). The currently accepted values are: \fBauto\fR (default), \fBalways\fR and \&\fBnever\fR. .SH FILES .IX Header "FILES" .IP \fI/var/lib/dpkg/diversions\fR 4 .IX Item "/var/lib/dpkg/diversions" File which contains the current list of diversions of the system. It is located in the \fBdpkg\fR administration directory, along with other files important to \fBdpkg\fR, such as \fIstatus\fR or \fIavailable\fR. .Sp \&\fBNote\fR: \fBdpkg-divert\fR preserves the old copy of this file, with extension \&\fI\-old\fR, before replacing it with the new one. .SH NOTES .IX Header "NOTES" When adding, default is \fB\-\-local\fR and \fB\-\-divert\fR \&\fIoriginal\fR\fB.distrib\fR. When removing, \fB\-\-package\fR or \&\fB\-\-local\fR and \fB\-\-divert\fR must match if specified. .PP Directories can't be diverted with \fBdpkg-divert\fR. .PP Care should be taken when diverting shared libraries, \fBldconfig\fR\|(8) creates a symbolic link based on the DT_SONAME field embedded in the library. Because \fBldconfig\fR does not honor diverts (only \fBdpkg\fR does), the symlink may end up pointing at the diverted library, if a diverted library has the same SONAME as the undiverted one. .SH EXAMPLES .IX Header "EXAMPLES" To divert all copies of a \fI/usr/bin/example\fR to \fI/usr/bin/example.foo\fR, i.e. directs all packages providing \fI/usr/bin/example\fR to install it as \&\fI/usr/bin/example.foo\fR, performing the rename if required: .PP .Vb 1 \& dpkg\-divert \-\-divert /usr/bin/example.foo \-\-rename /usr/bin/example .Ve .PP To remove that diversion: .PP .Vb 1 \& dpkg\-divert \-\-rename \-\-remove /usr/bin/example .Ve .PP To divert any package trying to install \fI/usr/bin/example\fR to \&\fI/usr/bin/example.foo\fR, except your own \fIwibble\fR package: .PP .Vb 2 \& dpkg\-divert \-\-package wibble \-\-divert /usr/bin/example.foo \e \& \-\-rename /usr/bin/example .Ve .PP To remove that diversion: .PP .Vb 1 \& dpkg\-divert \-\-package wibble \-\-rename \-\-remove /usr/bin/example .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBdpkg\fR\|(1).