<commit_before>.\"
.\" FreeBSD pkg - a next generation package for the installation and maintenance
.\" of non-core utilities.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\"
.\"     @(#)pkg.8
.\" $FreeBSD$
.\"
.Dd April 18, 2014
.Dt PKG-DELETE 8
.Os
.Sh NAME
.Nm "pkg delete"
.Nd deletes packages from the database and the system
.Sh SYNOPSIS
.Nm
.Op Fl DfnqRy
.Op Fl Cgix
.Ar pkg-name ...
.Nm
.Op Fl Dnqy
.Fl a
.Sh DESCRIPTION
.Nm
is used for deleting installed packages from the system.
.Nm
creates a work-list of all the installed packages matching the package
names on the command line.
The list is presented to the user.
If the user confirms that they do want to remove those packages, or
if the
.Cm ASSUME_ALWAYS_YES
configuration option is set,
.Nm
proceeds to remove the listed packages.
.Pp
If the set of packages to be deleted would leave installed packages
with unfulfilled dependencies,
.Nm
will emit an error message and quit without deleting anything unless
forced to proceed by the
.Fl f
option.
.Sh OPTIONS
The following options are supported by
.Nm :
.Bl -tag -width F1
.It Fl a
Deletes all installed packages from the system and empties the database.
.It Fl C
Make the standard or regular expression
.Fl ( x )
matching against
.Ar pkg-name
case sensitive.
.It Fl D
If a deinstallation script exists for a given package, do not execute it.
.It Fl f
Forces packages to be removed despite leaving unresolved dependencies.
.It Fl g
Treat the package names as shell glob patterns.
.It Fl i
Make the standard or regular expression
.Fl ( x )
matching against
.Ar pkg-name
case insensitive.
This is the defalt, unless modified by setting
.Ev CASE_SENSITIVE_MATCH
to true in
.Pa pkg.conf .
.It Fl n
Dry run mode.
The list of packages to delete is always printed, but no packages are
actually deleted.
.It Fl q
Force quiet output, except where
.Fl n
is also used, when
.Nm
will show the list of packages to be deleted.
.It Fl R
Delete all packages that require the listed packages as well.
.It Fl x
Treat the package names as regular expressions according to the
"modern" or "extended" syntax of
.Xr re_format 7 .
.It Fl y
Assume yes when asked for confirmation before package deletion.
.El
.Sh ENVIRONMENT
The following environment variables affect the execution of
.Nm .
See
.Xr pkg.conf 5<commit_msg>Document long options<commit_after>.\"
.\" FreeBSD pkg - a next generation package for the installation and maintenance
.\" of non-core utilities.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\"
.\"     @(#)pkg.8
.\" $FreeBSD$
.\"
.Dd May 26, 2014
.Dt PKG-DELETE 8
.Os
.Sh NAME
.Nm "pkg delete"
.Nd deletes packages from the database and the system
.Sh SYNOPSIS
.Nm
.Op Fl DfnqRy
.Op Fl Cgix
.Ar pkg-name ...
.Nm
.Op Fl Dnqy
.Fl a
.Pp
.Nm
.Op Cm --{no-deinstall-script,force,dry-run,quiet,recursive,yes}
.Op Cm --{case-sensitive,glob,case-insensitive,regex}
.Ar pkg-name ...
.Nm
.Op Cm --{no-deinstall-script,dry-run,quiet,yes}
.Cm --all
.Sh DESCRIPTION
.Nm
is used for deleting installed packages from the system.
.Nm
creates a work-list of all the installed packages matching the package
names on the command line.
The list is presented to the user.
If the user confirms that they do want to remove those packages, or
if the
.Cm ASSUME_ALWAYS_YES
configuration option is set,
.Nm
proceeds to remove the listed packages.
.Pp
If the set of packages to be deleted would leave installed packages
with unfulfilled dependencies,
.Nm
will emit an error message and quit without deleting anything unless
forced to proceed by the
.Fl f
option.
.Sh OPTIONS
The following options are supported by
.Nm :
.Bl -tag -width recursive
.It Fl a , Cm --all
Deletes all installed packages from the system and empties the database.
.It Fl C , Cm --case-sensitive
Make the standard or regular expression
.Fl ( x )
matching against
.Ar pkg-name
case sensitive.
.It Fl D , Cm --no-deinstall-script
If a deinstallation script exists for a given package, do not execute it.
.It Fl f , Cm --force
Forces packages to be removed despite leaving unresolved dependencies.
.It Fl g , Cm --glob
Treat the package names as shell glob patterns.
.It Fl i , Cm --case-insensitive
Make the standard or regular expression
.Fl ( x )
matching against
.Ar pkg-name
case insensitive.
This is the defalt, unless modified by setting
.Ev CASE_SENSITIVE_MATCH
to true in
.Pa pkg.conf .
.It Fl n , Cm --dry-run
Dry run mode.
The list of packages to delete is always printed, but no packages are
actually deleted.
.It Fl q , Cm --quiet
Force quiet output, except where
.Fl n
is also used, when
.Nm
will show the list of packages to be deleted.
.It Fl R , Cm --recursive
Delete all packages that require the listed packages as well.
.It Fl x , Cm --regex
Treat the package names as regular expressions according to the
"modern" or "extended" syntax of
.Xr re_format 7 .
.It Fl y , Cm --yes
Assume yes when asked for confirmation before package deletion.
.El
.Sh ENVIRONMENT
The following environment variables affect the execution of
.Nm .
See
.Xr pkg.conf 5
{'fraction_non_alphanumeric': 0.07200133645172069, 'fraction_numerical': 0.00417641162712997, 'mean_word_length': 3.52190332326284, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6297352', 'n_tokens_mistral': 1850, 'n_tokens_neox': 1709, 'n_words': 933}