You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

228 lines
6.4 KiB

  1. .\"
  2. .\" FreeBSD pkg - a next generation package for the installation and
  3. .\" maintenance of non-core utilities.
  4. .\"
  5. .\" Redistribution and use in source and binary forms, with or without
  6. .\" modification, are permitted provided that the following conditions
  7. .\" are met:
  8. .\" 1. Redistributions of source code must retain the above copyright
  9. .\" notice, this list of conditions and the following disclaimer.
  10. .\" 2. Redistributions in binary form must reproduce the above copyright
  11. .\" notice, this list of conditions and the following disclaimer in the
  12. .\" documentation and/or other materials provided with the distribution.
  13. .\"
  14. .\"
  15. .\" @(#)pkg.8
  16. .\" $FreeBSD$
  17. .\"
  18. .Dd November 18, 2014
  19. .Dt PKG-UPGRADE 8
  20. .Os
  21. .Sh NAME
  22. .Nm "pkg upgrade"
  23. .Nd perform upgrades of package software distributions
  24. .Sh SYNOPSIS
  25. .Nm
  26. .Op Fl fInFqUy
  27. .Op Fl r Ar reponame
  28. .Op Fl Cgix
  29. .Op Ar <pkg-origin|pkg-name|pkg-name-version> ...
  30. .Pp
  31. .Nm
  32. .Op Cm --{force,no-install-scripts,dry-run,fetch-only}
  33. .Op Cm --{quiet,no-repo-update,yes}
  34. .Op Cm --repository Ar reponame
  35. .Op Cm --{case-sensitive,glob,case-insensitive,regex}
  36. .Op Ar <pkg-origin|pkg-name|pkg-name-version> ...
  37. .Sh DESCRIPTION
  38. .Nm
  39. is used for upgrading packaged software distributions.
  40. .Pp
  41. .Nm
  42. compares the versions of all or specific packages installed on the system
  43. to what is available in the configured package repositories.
  44. Any out of date packages are added to a work list for processing.
  45. The difference to
  46. .Xr pkg-install 8
  47. is that
  48. .Nm
  49. tries to upgrade dependencies of packages matched as well while
  50. .Xr pkg-install 8
  51. is more conservative during dependencies upgrade. Moreover,
  52. .Nm
  53. cannot install new packages, so a caller should ensure that patterns specified
  54. as arguments have installed candidates for matching.
  55. If the
  56. .Fl f
  57. (force) flag is given, all installed packages are added to the work
  58. list.
  59. .Pp
  60. The package metadata downloaded from the repositories is then examined
  61. for each of the packages in the work list, and any missing
  62. dependencies are added to the work list as install jobs.
  63. Such implicitly added packages are flagged as candidates for
  64. autoremoval.
  65. See
  66. .Xr pkg-autoremove 8
  67. for details.
  68. .Pp
  69. Autoremoval flags are sticky, and will persist over reinstallation or
  70. upgrade of the packages concerned, even if subsequently the packages
  71. are named explicitly on a command line.
  72. See
  73. .Xr pkg-query 8
  74. for finding the autoremoval status of a package, and
  75. .Xr pkg-set 8
  76. for modifying it.
  77. .Pp
  78. Where a package on the work list supplies a shared library, and that
  79. library has been updated, all packages requiring that shared library
  80. will also be added to the work list as reinstallation jobs.
  81. .Pp
  82. The work list is sorted into dependency order and
  83. .Nm
  84. will present it to the user for approval before proceeding, unless
  85. overridden by the
  86. .Fl y
  87. option or the
  88. .Cm ASSUME_ALWAYS_YES
  89. setting in
  90. .Pa pkg.conf .
  91. .Pp
  92. Packages are fetched from the repositories into the local package
  93. cache if they are not already present, or if the checksum of the
  94. cached package file differs from the one in the repository.
  95. Packages may be downloaded from any of the repositories mentioned
  96. in
  97. .Xr pkg.conf 5
  98. or in the files in
  99. .Pa /usr/local/etc/pkg/repo .
  100. See
  101. .Xr pkg-repository 5
  102. for details.
  103. .Pp
  104. Package repository catalogues will be automatically updated whenever
  105. .Nm
  106. is run by a user ID with write access to the package database,
  107. unless disabled by the
  108. .Fl U
  109. flag or setting
  110. .Cm REPO_AUTOUPDATE
  111. to
  112. .Sy NO
  113. in
  114. .Xr pkg.conf 5 .
  115. .Pp
  116. Finally, the work list is executed in dependency order.
  117. Package reinstall or update jobs are processed by removing the currently
  118. installed package and immediately installing the replacement.
  119. New dependencies are processed as installation jobs as part of the
  120. work list.
  121. .Sh OPTIONS
  122. The following options are supported by
  123. .Nm :
  124. .Bl -tag -width repository
  125. .It Fl C , Cm --case-sensitive
  126. Make the standard or the regular expression
  127. .Fl ( x )
  128. matching against
  129. .Ar pkg-name
  130. case sensitive.
  131. .It Fl F , Cm --fetch-only
  132. Do not perform installation of packages, merely fetch packages that should be
  133. upgraded and detect possible conflicts.
  134. .It Fl f , Cm --force
  135. Force the reinstallation or upgrade of the whole set of packages.
  136. .It Fl g , Cm --glob
  137. Treat the package names as shell glob patterns.
  138. .It Fl I , Cm --no-install-scripts
  139. If any installation scripts (pre-install or post-install) or deinstallation
  140. scripts (pre-deinstall or post-deinstall) exist for a given package, do not
  141. execute them.
  142. .It Fl i , Cm --case-insensitive
  143. Make the standard or the regular expression
  144. .Fl ( x )
  145. matching against
  146. .Ar pkg-name
  147. case insensitive.
  148. This is the default, unless modified by setting
  149. .Ev CASE_SENSITIVE_MATCH
  150. to true in
  151. .Pa pkg.conf .
  152. .It Fl n , Cm --dry-run
  153. Dry-run mode: show what packages have updates available, but do not perform
  154. any upgrades.
  155. Repository catalogues will be updated as usual unless the
  156. .Fl U
  157. option is also given.
  158. .It Fl q , Cm --quiet
  159. Force quiet output, except when
  160. .Fl n
  161. is used, where a summary of the work list is always displayed.
  162. .It Fl r Ar reponame , Cm --repository Ar reponame
  163. Install packages from only the named repository,
  164. irrespective of the configured
  165. .Dq active
  166. status from
  167. .Pa repo.conf .
  168. .It Fl U , Cm --no-repo-update
  169. Suppress the automatic update of the local copy of the repository catalogue
  170. from remote.
  171. Automatic repository catalogue updates are only attempted when the
  172. effective UID of the process has write access to the package database.
  173. Otherwise they are silently ignored.
  174. .It Fl y , Cm --yes
  175. Assume yes when asked for confirmation before package installation.
  176. .El
  177. .Sh ENVIRONMENT
  178. The following environment variables affect the execution of
  179. .Nm .
  180. See
  181. .Xr pkg.conf 5
  182. for further description.
  183. .Bl -tag -width ".Ev NO_DESCRIPTIONS"
  184. .It Ev ASSUME_ALWAYS_YES
  185. .It Ev HANDLE_RC_SCRIPTS
  186. .It Ev PKG_CACHEDIR
  187. .It Ev PKG_DBDIR
  188. .It Ev REPO_AUTOUPDATE
  189. .El
  190. .Sh FILES
  191. See
  192. .Xr pkg.conf 5 .
  193. .Sh SEE ALSO
  194. .Xr pkg_printf 3 ,
  195. .Xr pkg_repos 3 ,
  196. .Xr pkg-repository 5 ,
  197. .Xr pkg.conf 5 ,
  198. .Xr pkg 8 ,
  199. .Xr pkg-add 8 ,
  200. .Xr pkg-annotate 8 ,
  201. .Xr pkg-audit 8 ,
  202. .Xr pkg-autoremove 8 ,
  203. .Xr pkg-backup 8 ,
  204. .Xr pkg-check 8 ,
  205. .Xr pkg-clean 8 ,
  206. .Xr pkg-config 8 ,
  207. .Xr pkg-convert 8 ,
  208. .Xr pkg-create 8 ,
  209. .Xr pkg-delete 8 ,
  210. .Xr pkg-fetch 8 ,
  211. .Xr pkg-info 8 ,
  212. .Xr pkg-install 8 ,
  213. .Xr pkg-lock 8 ,
  214. .Xr pkg-query 8 ,
  215. .Xr pkg-register 8 ,
  216. .Xr pkg-repo 8 ,
  217. .Xr pkg-rquery 8 ,
  218. .Xr pkg-search 8 ,
  219. .Xr pkg-set 8 ,
  220. .Xr pkg-shell 8 ,
  221. .Xr pkg-shlib 8 ,
  222. .Xr pkg-ssh 8 ,
  223. .Xr pkg-stats 8 ,
  224. .Xr pkg-update 8 ,
  225. .Xr pkg-updating 8 ,
  226. .Xr pkg-version 8 ,
  227. .Xr pkg-which 8