pkg_cutleaves
—
deinstall 'leaf' packages
pkg_cutleaves
finds installed
“leaf
” packages, i.e. packages that are
not referenced by any other installed package, and lets you decide for each
one if you want to keep or deinstall it (via pkg-delete(1)). Once the packages
marked for removal have been flushed/deinstalled, you'll be asked if you want
to do another run (i.e. to see packages that have become 'leaves' now because
you've deinstalled the package(s) that depended on them.
Note: see -R
below to bypass
interactive dependency removal). In every run you will be shown only packages
that you haven't marked for keeping, yet.
pkg_cutleaves
.
The following command line arguments are supported:
-c
- When listing leaf packages, also print their comments/short descriptions.
Will be ignored unless the
-l
parameter is given,
too.
-L
- Interpret exclude file as a list of leaf packages that
should be installed. Report lint such as lines that
match no installed packages or excluded packages that are not leaves.
-g
- Generate the exclude list from kept or installed (when run with
-l
or -L
) leaf packages.
-l
- List leaf packages only, one per line, and don't ask for anything to be
deinstalled.
-V
- Visual mode. Will compile a list of leaf packages and invoke the user's
EDITOR
. Lines or package names that are deleted in
the editor will then be removed.
-R
- Autoprune mode. Automatically deinstall non-required packages on which the
removed leaf packages depended. Will not remove packages on the exclude
list if
-x
is also in effect.
-x
- Exclude packages matching expressions given in the exclude file.
- Interactively cut leaf packages using the current exclude list:
pkg_cutleaves -x
- List all current leaf packages with comments:
pkg_cutleaves -lc
- List packages not currently excluded and regenerate a new exclude file
with both the listed and previously excluded packages:
pkg_cutleaves -lxg
- Interactively cut current leaf packages and remove newly discovered
leaves, i.e. dependencies, automatically:
pkg_cutleaves -R
- The same as the previous example but use the current exclude list to
filter all first-level leaves and any newly discovered leaves. Generate a
new exclude file with the remaining leaves:
pkg_cutleaves -Rxg
- Find exclude patterns that match nothing and those that match required
packages, i.e. non-leaves:
pkg_cutleaves -L
- /usr/local/etc/pkg_leaves.exclude
- An optional list for excluding packages when the
-x
or -L
options are
given. If the beginning of a package's name matches any line (except
comment or empty lines) in this file, the package will not be
listed/offered for removal (e.g., a line saying just
XFree86 will exclude all packages with names
starting with “XFree86
” ). The list
can be auto-generated with the -g
option.
The following environment variables will be used in visual mode:
EDITOR
- The editor specified by the variable
EDITOR
will
be invoked instead of the default editor
vi(1).
Stefan Walter <sw@gegenunendlich.de>