/ docs / pkg-unregister.8
pkg-unregister.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 December 13, 2025
 18  .Dt PKG-UNREGISTER 8
 19  .Os
 20  .Sh NAME
 21  .Nm "pkg unregister"
 22  .Nd deletes package records from the database
 23  .Sh SYNOPSIS
 24  .Nm
 25  .Op Fl fnqRy
 26  .Op Fl Cgix
 27  .Ar pkg-name ...
 28  .Nm
 29  .Op Fl nqy
 30  .Fl a
 31  .Pp
 32  .Nm
 33  .Op Cm --{force,dry-run,quiet,recursive,yes}
 34  .Op Cm --{case-sensitive,glob,case-insensitive,regex}
 35  .Ar pkg-name ...
 36  .Nm
 37  .Op Cm --{dry-run,quiet,yes}
 38  .Cm --all
 39  .Sh DESCRIPTION
 40  .Nm
 41  is used for deleting installed packages from the database.
 42  .Nm
 43  creates a work-list of all the installed packages matching the package
 44  names on the command line.
 45  The list is presented to the user.
 46  If the user confirms that they do want to remove those packages
 47  from the db, or if the
 48  .Cm ASSUME_ALWAYS_YES
 49  configuration option is set,
 50  .Nm
 51  proceeds to remove from the db the listed packages.
 52  .Pp
 53  If the set of packages to be unregistered would leave installed packages
 54  with unfulfilled dependencies,
 55  .Nm
 56  will add the packages with unfulfilled dependencies to the list of
 57  packages to be unregistered, unless forced to proceed without unregistering any
 58  other packages by the
 59  .Fl f
 60  option.
 61  .Pp
 62  .Nm
 63  avoids deleting itself unless named specifically on the command line.
 64  So, for instance,
 65  .Nm Fl a
 66  will unregister all packages from the db except for the
 67  .Xr pkg 8
 68  package.
 69  To force all packages to be unregistered from the db without exception, use
 70  .Nm Fl fa .
 71  .Sh OPTIONS
 72  The following options are supported by
 73  .Nm :
 74  .Bl -tag -width recursive
 75  .It Fl a , Cm --all
 76  Deletes all installed packages from the db except for
 77  .Xr pkg 8
 78  and cleans the database of information related to removed
 79  packages.
 80  .It Fl C , Cm --case-sensitive
 81  Make the standard or regular expression
 82  .Fl ( x )
 83  matching against
 84  .Ar pkg-name
 85  case sensitive.
 86  .It Fl f , Cm --force
 87  Forces packages to be removed from the db despite leaving unresolved dependencies.
 88  In combination with the
 89  .Fl a
 90  or
 91  .Fl -all
 92  flag, causes
 93  .Xr pkg 8
 94  to be removed as well as all other packages.
 95  .It Fl g , Cm --glob
 96  Treat the package names as shell glob patterns.
 97  .It Fl i , Cm --case-insensitive
 98  Make the standard or regular expression
 99  .Fl ( x )
100  matching against
101  .Ar pkg-name
102  case insensitive.
103  This is the default, unless modified by setting
104  .Ev CASE_SENSITIVE_MATCH
105  to true in
106  .Pa pkg.conf .
107  .It Fl n , Cm --dry-run
108  Dry run mode.
109  The list of packages to delete is always printed, but no packages are
110  actually deleted.
111  .It Fl q , Cm --quiet
112  Force quiet output, except where
113  .Fl n
114  is also used, when
115  .Nm
116  will show the list of packages to be deleted.
117  .It Fl R , Cm --recursive
118  Delete all packages that require the listed packages as well.
119  .It Fl x , Cm --regex
120  Treat the package names as regular expressions according to the
121  "modern" or "extended" syntax of
122  .Xr re_format 7 .
123  .It Fl y , Cm --yes
124  Assume yes when asked for confirmation before package deletion.
125  .El
126  .Sh ENVIRONMENT
127  The following environment variables affect the execution of
128  .Nm .
129  See
130  .Xr pkg.conf 5
131  for further description.
132  .Bl -tag -width ".Ev NO_DESCRIPTIONS"
133  .It Ev DEFAULT_ALWAYS_YES
134  .It Ev ASSUME_ALWAYS_YES
135  .It Ev HANDLE_RC_SCRIPTS
136  .It Ev PKG_DBDIR
137  .It Ev CASE_SENSITIVE_MATCH
138  .El
139  .Sh FILES
140  See
141  .Xr pkg.conf 5 .
142  .Sh SEE ALSO
143  .Xr pkg_create 3 ,
144  .Xr pkg_printf 3 ,
145  .Xr pkg_repo_create 3 ,
146  .Xr pkg_repos 3 ,
147  .Xr pkg-keywords 5 ,
148  .Xr pkg-lua-script 5 ,
149  .Xr pkg-repository 5 ,
150  .Xr pkg-script 5 ,
151  .Xr pkg-triggers 5 ,
152  .Xr pkg.conf 5 ,
153  .Xr pkg 8 ,
154  .Xr pkg-add 8 ,
155  .Xr pkg-alias 8 ,
156  .Xr pkg-annotate 8 ,
157  .Xr pkg-audit 8 ,
158  .Xr pkg-autoremove 8 ,
159  .Xr pkg-check 8 ,
160  .Xr pkg-clean 8 ,
161  .Xr pkg-config 8 ,
162  .Xr pkg-create 8 ,
163  .Xr pkg-delete 8 ,
164  .Xr pkg-fetch 8 ,
165  .Xr pkg-help 8 ,
166  .Xr pkg-info 8 ,
167  .Xr pkg-install 8 ,
168  .Xr pkg-key 8 ,
169  .Xr pkg-lock 8 ,
170  .Xr pkg-plugins 8 ,
171  .Xr pkg-query 8 ,
172  .Xr pkg-register 8 ,
173  .Xr pkg-repo 8 ,
174  .Xr pkg-repositories 8 ,
175  .Xr pkg-rquery 8 ,
176  .Xr pkg-search 8 ,
177  .Xr pkg-set 8 ,
178  .Xr pkg-shell 8 ,
179  .Xr pkg-shlib 8 ,
180  .Xr pkg-ssh 8 ,
181  .Xr pkg-stats 8 ,
182  .Xr pkg-triggers 8 ,
183  .Xr pkg-update 8 ,
184  .Xr pkg-updating 8 ,
185  .Xr pkg-upgrade 8 ,
186  .Xr pkg-version 8 ,
187  .Xr pkg-which 8