dpkg-divert.8 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. .\" dpkg manual page - dpkg-divert(8)
  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-2011 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 8 "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
  40. file, or whenever some files (which aren't marked as 'conffiles') 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. Prints LOCAL if
  57. \fIfile\fP is locally diverted and nothing if \fIfile\fP is not diverted.
  58. .TP
  59. .BI \-\-truename " file"
  60. Print the real name for a diverted file.
  61. .
  62. .SH OPTIONS
  63. .TP
  64. .BI \-\-admindir " directory"
  65. Set the \fBdpkg\fP data directory to \fIdirectory\fP (default:
  66. \fI/var/lib/dpkg\fP).
  67. .TP
  68. .BI \-\-divert " divert-to"
  69. \fIdivert-to\fP is the location where the versions of \fIfile\fP, as
  70. provided by other packages, will be diverted.
  71. .TP
  72. .B \-\-local
  73. Specifies that all packages' versions of this file are diverted.
  74. This means, that there are no exceptions, and whatever package is installed,
  75. the file is diverted. This can be used by an admin to install a locally
  76. modified version.
  77. .TP
  78. .BI \-\-package " package"
  79. \fIpackage\fP is the name of a package whose copy of \fIfile\fP will not
  80. be diverted. i.e. \fIfile\fP will be diverted for all packages except
  81. \fIpackage\fP.
  82. .TP
  83. .B \-\-quiet
  84. Quiet mode, i.e. no verbose output.
  85. .TP
  86. .B \-\-rename
  87. Actually move the file aside (or back). \fBdpkg\-divert\fP will abort operation
  88. in case the destination file already exists.
  89. .TP
  90. .B \-\-test
  91. Test mode, i.e. don't actually perform any changes, just demonstrate.
  92. .TP
  93. .BR \-? ", " \-\-help
  94. Show the usage message and exit.
  95. .TP
  96. .B \-\-version
  97. Show the version and exit.
  98. .
  99. .SH ENVIRONMENT
  100. .TP
  101. .B DPKG_ADMINDIR
  102. If set and the \fB\-\-admindir\fP option has not been specified, it will
  103. be used as the \fBdpkg\fP data directory.
  104. .TP
  105. .B DPKG_MAINTSCRIPT_PACKAGE
  106. If set and the \fB\-\-local\fP and \fB\-\-package\fP options have not been
  107. specified, \fBdpkg\-divert\fP will use it as the package name.
  108. .
  109. .SH FILES
  110. .TP
  111. .I /var/lib/dpkg/diversions
  112. File which contains the current list of diversions of the system. It is
  113. located in the \fBdpkg\fP administration directory, along with other files
  114. important to \fBdpkg\fP, such as \fIstatus\fP or \fIavailable\fP.
  115. .br
  116. Note: \fBdpkg\-divert\fP preserves the old copy of this file, with extension
  117. \fI\-old\fP, before replacing it with the new one.
  118. .
  119. .SH NOTES
  120. When adding, default is \fB\-\-local\fP and \fB\-\-divert\fP
  121. \fIoriginal\fP\fB.distrib\fP. When removing, \fB\-\-package\fP or
  122. \fB\-\-local\fP and \fB\-\-divert\fP must match if specified.
  123. Directories can't be diverted with \fBdpkg\-divert\fP.
  124. Care should be taken when diverting shared libraries, \fBldconfig\fP(8)
  125. creates a symbolic link based on the DT_SONAME field embedded in the library.
  126. Because \fBldconfig\fP doesn't honour diverts (only \fBdpkg\fP does),
  127. the symlink may end up pointing at the diverted library, if a diverted
  128. library has the same SONAME as the undiverted one.
  129. .
  130. .SH EXAMPLES
  131. To divert all copies of a \fI/usr/bin/example\fR to \fI/usr/bin/example.foo\fR,
  132. i.e. directs all packages providing \fI/usr/bin/example\fR to install it as
  133. \fI/usr/bin/example.foo\fR, performing the rename if required:
  134. .HP
  135. dpkg\-divert \-\-divert /usr/bin/example.foo \-\-rename /usr/bin/example
  136. .PP
  137. To remove that diversion:
  138. .HP
  139. dpkg\-divert \-\-rename \-\-remove /usr/bin/example
  140. .PP
  141. To divert any package trying to install \fI/usr/bin/example\fR to
  142. \fI/usr/bin/example.foo\fR, except your own \fIwibble\fR package:
  143. .HP
  144. dpkg\-divert \-\-package wibble \-\-divert /usr/bin/example.foo \-\-rename /usr/bin/example
  145. .PP
  146. To remove that diversion:
  147. .HP
  148. dpkg\-divert \-\-package wibble \-\-rename \-\-remove /usr/bin/example
  149. .
  150. .SH SEE ALSO
  151. .BR dpkg (1).