/ docs / pkg-set.8
pkg-set.8
  1  .\"
  2  .\" FreeBSD pkg - a next generation package for the installation and maintenance
  3  .\" 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  .\"
 17  .Dd August 27, 2025
 18  .Dt PKG-SET 8
 19  .Os
 20  .Sh NAME
 21  .Nm "pkg set"
 22  .Nd modify information in the installed database
 23  .Sh SYNOPSIS
 24  .Nm
 25  .Op Fl a
 26  .Op Fl A Ar 0|1
 27  .Op Fl n Ar oldname:newname
 28  .Op Fl o Ar oldorigin:neworigin
 29  .Op Fl p
 30  .Op Fl v Ar 0|1
 31  .Op Fl y
 32  .Op Fl Cgix
 33  .Ar pkg-name
 34  .Pp
 35  .Nm
 36  .Op Cm --all
 37  .Op Cm --automatic Ar 0|1
 38  .Op Cm --change-name Ar oldname:newname
 39  .Op Cm --change-origin Ar oldorigin:neworigin
 40  .Op Cm --partial
 41  .Op Cm --yes
 42  .Op Fl v Ar 0|1
 43  .Op Cm --{case-sensitive,glob,case-insensitive,regex}
 44  .Ar pkg-name
 45  .Sh DESCRIPTION
 46  .Nm
 47  is used to modify information concerning installed packages.
 48  .Nm
 49  should always be used with caution.
 50  .Sh OPTIONS
 51  The following options are supported by
 52  .Nm :
 53  .Bl -tag -width automatic
 54  .It Fl A Ar 0|1 , Cm --automatic Ar 0|1
 55  Set automatic flag for the package: 0 is not automatic, 1 is automatic.
 56  This affects the operation of
 57  .Xr pkg-autoremove 8 .
 58  .It Fl a , Cm --all
 59  Match all installed packages.
 60  .It Fl C , Cm --case-sensitive
 61  Make the standard or the regular expression
 62  .Fl ( x )
 63  matching against
 64  .Ar pkg-name
 65  case sensitive.
 66  .It Fl g , Cm --glob
 67  Match
 68  .Ar pkg-name
 69  as a globbing expression.
 70  .It Fl i , Cm --case-insensitive
 71  Make the standard or regular expression
 72  .Fl ( x )
 73  matching against
 74  .Ar pkg-name
 75  case insensitive.
 76  This is the default, unless modified by setting
 77  .Ev CASE_SENSITIVE_MATCH
 78  to true in
 79  .Pa pkg.conf .
 80  .It Fl n Ar oldname:newname , Cm --change-name Ar oldname:newname
 81  Change the package name of a given dependency from
 82  .Ar oldname
 83  to
 84  .Ar newname .
 85  .It Fl o Ar oldorigin:neworigin , Cm --change-origin Ar oldorigin:neworigin
 86  Change the port origin of a given dependency from
 87  .Ar oldorigin
 88  to
 89  .Ar neworigin .
 90  This corresponds to the port directory that the package originated from.
 91  Typically, this is only needed for upgrading a library or package that
 92  has MOVED or when the default version of a major port dependency
 93  changes. (DEPRECATED)
 94  Usually this will be explained in /usr/ports/UPDATING.
 95  Also see
 96  .Xr pkg-updating 8
 97  and
 98  .Sx EXAMPLES .
 99  .It Fl p , Cm --partial
100  Turn the
101  .Fl o
102  or
103  .Fl -n
104  options from exact match renames into substring search in replace in all
105  installed packages.
106  .It Fl x , Cm --regex
107  Match
108  .Ar pkg-name
109  as a regular expression according to the "modern" or "extended" syntax of
110  .Xr re_format 7 .
111  .It Fl v Ar 0|1 , Cm --vital Ar 0|1
112  Set or unset the
113  .Qq vital
114  flag on the target package(s).
115  Set to
116  .Ar 0
117  to disable the
118  .Qq vital
119  flag, and
120  .Ar 1
121  to enable it.
122  .It Fl y , Cm --yes
123  Assume yes rather than asking for confirmation before modifying package information.
124  .El
125  .Pp
126  If neither the
127  .Fl g
128  nor
129  .Fl x
130  options are used, the default is to match pkg-name exactly.
131  .Sh FILES
132  See
133  .Xr pkg.conf 5 .
134  .Sh EXAMPLES
135  Change a package from automatic to non-automatic, which will prevent
136  .Ic autoremove
137  from removing it:
138  .Dl % pkg set -A 0 perl-5.14
139  .Pp
140  Change a package from non-automatic to automatic, which will make
141  .Ic autoremove
142  allow it be removed once nothing depends on it:
143  .Dl % pkg set -A 1 perl-5.14
144  .Pp
145  Rename all the php83- packages into php84- packages in order to prepare
146  for an upgrade
147  .Dl % pkg set -p -n php83:php84
148  .Sh ENVIRONMENT
149  The following environment variables affect the execution of
150  .Nm .
151  See
152  .Xr pkg.conf 5
153  for further description.
154  .Bl -tag -width ".Ev NO_DESCRIPTIONS"
155  .It Ev CASE_SENSITIVE_MATCH
156  .El
157  .Sh SEE ALSO
158  .Xr pkg_create 3 ,
159  .Xr pkg_printf 3 ,
160  .Xr pkg_repo_create 3 ,
161  .Xr pkg_repos 3 ,
162  .Xr pkg-keywords 5 ,
163  .Xr pkg-lua-script 5 ,
164  .Xr pkg-repository 5 ,
165  .Xr pkg-script 5 ,
166  .Xr pkg-triggers 5 ,
167  .Xr pkg.conf 5 ,
168  .Xr pkg 8 ,
169  .Xr pkg-add 8 ,
170  .Xr pkg-alias 8 ,
171  .Xr pkg-annotate 8 ,
172  .Xr pkg-audit 8 ,
173  .Xr pkg-autoremove 8 ,
174  .Xr pkg-check 8 ,
175  .Xr pkg-clean 8 ,
176  .Xr pkg-config 8 ,
177  .Xr pkg-create 8 ,
178  .Xr pkg-delete 8 ,
179  .Xr pkg-fetch 8 ,
180  .Xr pkg-help 8 ,
181  .Xr pkg-info 8 ,
182  .Xr pkg-install 8 ,
183  .Xr pkg-key 8 ,
184  .Xr pkg-lock 8 ,
185  .Xr pkg-plugins 8 ,
186  .Xr pkg-query 8 ,
187  .Xr pkg-register 8 ,
188  .Xr pkg-repo 8 ,
189  .Xr pkg-repositories 8 ,
190  .Xr pkg-rquery 8 ,
191  .Xr pkg-search 8 ,
192  .Xr pkg-shell 8 ,
193  .Xr pkg-shlib 8 ,
194  .Xr pkg-ssh 8 ,
195  .Xr pkg-stats 8 ,
196  .Xr pkg-triggers 8 ,
197  .Xr pkg-unregister 8 ,
198  .Xr pkg-update 8 ,
199  .Xr pkg-updating 8 ,
200  .Xr pkg-upgrade 8 ,
201  .Xr pkg-version 8 ,
202  .Xr pkg-which 8