dpkg-divert.8 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. .TH dpkg\-divert 8 "2007-07-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 \-\-truename " file"
  36. Print the real name for a diverted file.
  37. .
  38. .SH OPTIONS
  39. .TP
  40. .BI \-\-admindir " directory"
  41. Set the dpkg data directory to \fIdirectory\fP (default: \fI/var/lib/dpkg\fP).
  42. .TP
  43. .BI \-\-divert " divert-to"
  44. \fIdivert-to\fP is the location where the versions of \fIfile\fP, as
  45. provided by other packages, will be diverted.
  46. .TP
  47. .B \-\-local
  48. Specifies that all packages' versions of this file are diverted.
  49. This means, that there are no exceptions, and whatever package is installed,
  50. the file is diverted. This can be used by an admin to install a locally
  51. modified version.
  52. .TP
  53. .BI \-\-package " package"
  54. \fIpackage\fP is the name of a package whose copy of \fIfile\fP will not
  55. be diverted. i.e. \fIfile\fP will be diverted for all packages except
  56. \fIpackage\fP.
  57. .TP
  58. .B \-\-quiet
  59. Quiet mode, i.e. no verbose output.
  60. .TP
  61. .B \-\-rename
  62. Actually move the file aside (or back). \fBdpkg\-divert\fP will abort operation
  63. in case the destination file already exists.
  64. .TP
  65. .B \-\-test
  66. Test mode, i.e. don't actually perform any changes, just demonstrate.
  67. .TP
  68. .B \-\-help
  69. Show the usage message and exit.
  70. .TP
  71. .B \-\-version
  72. Show the version and exit.
  73. .
  74. .SH NOTES
  75. When adding, default is \fB\-\-local\fP and \fB\-\-divert\fP
  76. \fI<original>.distrib\fP. When removing, \fB\-\-package\fP or \fB\-\-local\fP
  77. and \fB\-\-divert\fP must match if specified.
  78. Directories can't be diverted with \fBdpkg\-divert\fP.
  79. Care should be taken when diverting shared libraries, \fBldconfig\fP(8)
  80. creates a symbolic link based on the DT_SONAME field embedded in the library.
  81. Because ldconfig doesn't honour diverts (only dpkg does), the symlink may
  82. end up pointing at the diverted library, if a diverted library has the
  83. same SONAME as the undiverted one.
  84. .
  85. .SH EXAMPLES
  86. To divert all copies of a \fI/usr/bin/example\fR to \fI/usr/bin/example.foo\fR,
  87. i.e. directs all packages providing \fI/usr/bin/example\fR to install it as
  88. \fI/usr/bin/example.foo\fR, performing the rename if required:
  89. .HP
  90. dpkg-divert \-\-divert /usr/bin/example.foo \-\-rename /usr/bin/example
  91. .PP
  92. To remove that diversion:
  93. .HP
  94. dpkg-divert \-\-rename \-\-remove /usr/bin/example
  95. .PP
  96. To divert any package trying to install \fI/usr/bin/example\fR to
  97. \fI/usr/bin/example.foo\fR, except your own \fIwibble\fR package:
  98. .HP
  99. dpkg-divert \-\-package wibble \-\-divert /usr/bin/example.foo \-\-rename /usr/bin/example
  100. .PP
  101. To remove that diversion:
  102. .HP
  103. dpkg-divert \-\-package wibble \-\-rename \-\-remove /usr/bin/example
  104. .
  105. .SH FILES
  106. .TP
  107. .I /var/lib/dpkg/diversions
  108. File which contains the current list of diversions of the system. It is
  109. located in the dpkg administration directory, along with other files
  110. important to dpkg, such as \fIstatus\fP or \fIavailable\fP.
  111. .br
  112. Note: \fBdpkg\-divert\fP preserves the old copy of this file, with extension
  113. \fI\-old\fP, before replacing it with the new one.
  114. .
  115. .SH SEE ALSO
  116. .BR dpkg (1).
  117. .
  118. .SH AUTHOR
  119. Copyright (C) 1995 Ian Jackson
  120. .sp
  121. This is free software; see the GNU General Public Licence version 2 or
  122. later for copying conditions. There is NO WARRANTY.