dpkg-divert.8 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. .TH dpkg\-divert 8 "2008-08-18" "Debian Project" "dpkg utilities"
  2. .SH NAME
  3. dpkg\-divert \- override a package's version of a file
  4. .
  5. .SH SYNOPSIS
  6. .B dpkg\-divert
  7. .RI [ options ]
  8. .I command
  9. .
  10. .SH DESCRIPTION
  11. .B dpkg\-divert
  12. is the utility used to set up and update the list of diversions.
  13. .PP
  14. File \fIdiversions\fP are a way of forcing
  15. .BR dpkg (1)
  16. not to install a file into its
  17. location, but to a \fIdiverted\fP location. Diversions can be used through the
  18. Debian package scripts to move a file away when it causes a conflict. System
  19. administrators can also use it to override some package's configuration
  20. file, or whenever some files (which aren't marked as 'conffiles') need to be
  21. preserved by dpkg, when installing a newer version of a package which
  22. contains those files.
  23. .sp
  24. .SH COMMANDS
  25. .TP
  26. .RB [ \-\-add "] \fIfile\fP"
  27. Add a diversion for \fIfile\fP.
  28. .TP
  29. .BI \-\-remove " file"
  30. Remove a diversion for \fIfile\fP.
  31. .TP
  32. .BI \-\-list " glob-pattern"
  33. List diversions matching \fIglob-pattern\fP.
  34. .TP
  35. .BI \-\-listpackage " file"
  36. Print the name of the package that diverts \fIfile\fP. Prints LOCAL if
  37. \fIfile\fP is locally diverted and nothing if \fIfile\fP is not diverted.
  38. .TP
  39. .BI \-\-truename " file"
  40. Print the real name for a diverted file.
  41. .
  42. .SH OPTIONS
  43. .TP
  44. .BI \-\-admindir " directory"
  45. Set the dpkg data directory to \fIdirectory\fP (default: \fI/var/lib/dpkg\fP).
  46. .TP
  47. .BI \-\-divert " divert-to"
  48. \fIdivert-to\fP is the location where the versions of \fIfile\fP, as
  49. provided by other packages, will be diverted.
  50. .TP
  51. .B \-\-local
  52. Specifies that all packages' versions of this file are diverted.
  53. This means, that there are no exceptions, and whatever package is installed,
  54. the file is diverted. This can be used by an admin to install a locally
  55. modified version.
  56. .TP
  57. .BI \-\-package " package"
  58. \fIpackage\fP is the name of a package whose copy of \fIfile\fP will not
  59. be diverted. i.e. \fIfile\fP will be diverted for all packages except
  60. \fIpackage\fP.
  61. .TP
  62. .B \-\-quiet
  63. Quiet mode, i.e. no verbose output.
  64. .TP
  65. .B \-\-rename
  66. Actually move the file aside (or back). \fBdpkg\-divert\fP will abort operation
  67. in case the destination file already exists.
  68. .TP
  69. .B \-\-test
  70. Test mode, i.e. don't actually perform any changes, just demonstrate.
  71. .TP
  72. .B \-\-help
  73. Show the usage message and exit.
  74. .TP
  75. .B \-\-version
  76. Show the version and exit.
  77. .
  78. .SH NOTES
  79. When adding, default is \fB\-\-local\fP and \fB\-\-divert\fP
  80. \fI<original>.distrib\fP. When removing, \fB\-\-package\fP or \fB\-\-local\fP
  81. and \fB\-\-divert\fP must match if specified.
  82. Directories can't be diverted with \fBdpkg\-divert\fP.
  83. Care should be taken when diverting shared libraries, \fBldconfig\fP(8)
  84. creates a symbolic link based on the DT_SONAME field embedded in the library.
  85. Because ldconfig doesn't honour diverts (only dpkg does), the symlink may
  86. end up pointing at the diverted library, if a diverted library has the
  87. same SONAME as the undiverted one.
  88. .
  89. .SH EXAMPLES
  90. To divert all copies of a \fI/usr/bin/example\fR to \fI/usr/bin/example.foo\fR,
  91. i.e. directs all packages providing \fI/usr/bin/example\fR to install it as
  92. \fI/usr/bin/example.foo\fR, performing the rename if required:
  93. .HP
  94. dpkg-divert \-\-divert /usr/bin/example.foo \-\-rename /usr/bin/example
  95. .PP
  96. To remove that diversion:
  97. .HP
  98. dpkg-divert \-\-rename \-\-remove /usr/bin/example
  99. .PP
  100. To divert any package trying to install \fI/usr/bin/example\fR to
  101. \fI/usr/bin/example.foo\fR, except your own \fIwibble\fR package:
  102. .HP
  103. dpkg-divert \-\-package wibble \-\-divert /usr/bin/example.foo \-\-rename /usr/bin/example
  104. .PP
  105. To remove that diversion:
  106. .HP
  107. dpkg-divert \-\-package wibble \-\-rename \-\-remove /usr/bin/example
  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 dpkg administration directory, along with other files
  114. important to dpkg, 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 SEE ALSO
  120. .BR dpkg (1).
  121. .
  122. .SH AUTHOR
  123. Copyright \(co 1995 Ian Jackson
  124. .sp
  125. This is free software; see the GNU General Public Licence version 2 or
  126. later for copying conditions. There is NO WARRANTY.