dpkg-divert.1 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. .\" dpkg manual page - dpkg-divert(1)
  2. .\"
  3. .\" Copyright © 1995 Ian Jackson <ian@chiark.chu.cam.ac.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>
  7. .\"
  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.
  12. .\"
  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.
  17. .\"
  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/>.
  20. .
  21. .TH dpkg\-divert 1 "2011-08-14" "Debian Project" "dpkg utilities"
  22. .SH NAME
  23. dpkg\-divert \- override a package's version of a file
  24. .
  25. .SH SYNOPSIS
  26. .B dpkg\-divert
  27. .RI [ option ...]
  28. .I command
  29. .
  30. .SH DESCRIPTION
  31. .B dpkg\-divert
  32. is the utility used to set up and update the list of diversions.
  33. .PP
  34. File \fIdiversions\fP are a way of forcing
  35. .BR dpkg (1)
  36. not to install a file into its
  37. location, but to a \fIdiverted\fP location. Diversions can be used through the
  38. Debian package scripts to move a file away when it causes a conflict. System
  39. administrators can also use it to override some package's configuration file,
  40. or whenever some files (which aren't marked as \(lqconffiles\(rq) need to be
  41. preserved by \fBdpkg\fP, when installing a newer version of a package which
  42. contains those files.
  43. .sp
  44. .SH COMMANDS
  45. .TP
  46. .RB [ \-\-add "] \fIfile\fP"
  47. Add a diversion for \fIfile\fP.
  48. .TP
  49. .BI \-\-remove " file"
  50. Remove a diversion for \fIfile\fP.
  51. .TP
  52. .BI \-\-list " glob-pattern"
  53. List diversions matching \fIglob-pattern\fP.
  54. .TP
  55. .BI \-\-listpackage " file"
  56. Print the name of the package that diverts \fIfile\fP (since dpkg 1.15.0).
  57. Prints LOCAL if
  58. \fIfile\fP is locally diverted and nothing if \fIfile\fP is not diverted.
  59. .TP
  60. .BI \-\-truename " file"
  61. Print the real name for a diverted file.
  62. .
  63. .SH OPTIONS
  64. .TP
  65. .BI \-\-admindir " directory"
  66. Set the \fBdpkg\fP data directory to \fIdirectory\fP (default:
  67. \fI/var/lib/dpkg\fP).
  68. .TP
  69. .BI \-\-divert " divert-to"
  70. \fIdivert-to\fP is the location where the versions of \fIfile\fP, as
  71. provided by other packages, will be diverted.
  72. .TP
  73. .B \-\-local
  74. Specifies that all packages' versions of this file are diverted.
  75. This means, that there are no exceptions, and whatever package is installed,
  76. the file is diverted. This can be used by an admin to install a locally
  77. modified version.
  78. .TP
  79. .BI \-\-package " package"
  80. \fIpackage\fP is the name of a package whose copy of \fIfile\fP will not
  81. be diverted. i.e. \fIfile\fP will be diverted for all packages except
  82. \fIpackage\fP.
  83. .TP
  84. .B \-\-quiet
  85. Quiet mode, i.e. no verbose output.
  86. .TP
  87. .B \-\-rename
  88. Actually move the file aside (or back). \fBdpkg\-divert\fP will abort operation
  89. in case the destination file already exists.
  90. .TP
  91. .B \-\-test
  92. Test mode, i.e. don't actually perform any changes, just demonstrate.
  93. .TP
  94. .BR \-? ", " \-\-help
  95. Show the usage message and exit.
  96. .TP
  97. .B \-\-version
  98. Show the version and exit.
  99. .
  100. .SH ENVIRONMENT
  101. .TP
  102. .B DPKG_ADMINDIR
  103. If set and the \fB\-\-admindir\fP option has not been specified, it will
  104. be used as the \fBdpkg\fP data directory.
  105. .TP
  106. .B DPKG_MAINTSCRIPT_PACKAGE
  107. If set and the \fB\-\-local\fP and \fB\-\-package\fP options have not been
  108. specified, \fBdpkg\-divert\fP will use it as the package name.
  109. .
  110. .SH FILES
  111. .TP
  112. .I /var/lib/dpkg/diversions
  113. File which contains the current list of diversions of the system. It is
  114. located in the \fBdpkg\fP administration directory, along with other files
  115. important to \fBdpkg\fP, such as \fIstatus\fP or \fIavailable\fP.
  116. .br
  117. Note: \fBdpkg\-divert\fP preserves the old copy of this file, with extension
  118. \fI\-old\fP, before replacing it with the new one.
  119. .
  120. .SH NOTES
  121. When adding, default is \fB\-\-local\fP and \fB\-\-divert\fP
  122. \fIoriginal\fP\fB.distrib\fP. When removing, \fB\-\-package\fP or
  123. \fB\-\-local\fP and \fB\-\-divert\fP must match if specified.
  124. Directories can't be diverted with \fBdpkg\-divert\fP.
  125. Care should be taken when diverting shared libraries, \fBldconfig\fP(8)
  126. creates a symbolic link based on the DT_SONAME field embedded in the library.
  127. Because \fBldconfig\fP doesn't honour diverts (only \fBdpkg\fP does),
  128. the symlink may end up pointing at the diverted library, if a diverted
  129. library has the same SONAME as the undiverted one.
  130. .
  131. .SH EXAMPLES
  132. To divert all copies of a \fI/usr/bin/example\fR to \fI/usr/bin/example.foo\fR,
  133. i.e. directs all packages providing \fI/usr/bin/example\fR to install it as
  134. \fI/usr/bin/example.foo\fR, performing the rename if required:
  135. .HP
  136. dpkg\-divert \-\-divert /usr/bin/example.foo \-\-rename /usr/bin/example
  137. .PP
  138. To remove that diversion:
  139. .HP
  140. dpkg\-divert \-\-rename \-\-remove /usr/bin/example
  141. .PP
  142. To divert any package trying to install \fI/usr/bin/example\fR to
  143. \fI/usr/bin/example.foo\fR, except your own \fIwibble\fR package:
  144. .HP
  145. dpkg\-divert \-\-package wibble \-\-divert /usr/bin/example.foo \-\-rename /usr/bin/example
  146. .PP
  147. To remove that diversion:
  148. .HP
  149. dpkg\-divert \-\-package wibble \-\-rename \-\-remove /usr/bin/example
  150. .
  151. .SH SEE ALSO
  152. .BR dpkg (1).