apk_delete — a utility for deleting previously installed software packages
apk_delete
[-DfhnpqRrv
] [-p
prefix
] apkname
...
The apk_delete command is used to delete packages that have been previously installed with the apk_add command.
Since the apk_delete command may execute scripts or programs contained within a package file, your system may be susceptible to “trojan horses” or other subtle attacks from miscreants who create dangerous package files.
You are advised to verify the competence and identity of those who provide installable package files.
The following command line arguments are supported:
apkname
The named packages are deinstalled where apkname
is
a package name with or without version number.
-D
If a deinstallation script exist for a given package, do not execute it.
-f
Force removal of the package, even if a dependency is recorded or the pre-deinstall script fails.
-h
Show help and exit.
-n
Don't actually deinstall a package, just report the steps that would be taken if it were.
-p
prefix
Set prefix
as
the $ROOT
directory in which to
delete files from.
-q
Quiet mode. Supress non-error messages.
-R
Remove all those packages required by the given packages as well.
-r
Remove all those packages depending on the given packages as well.
-v
Turn on verbose output.
The apk_delete utility runs through the following sequence to deinstall a package:
A check is made to determine if the package is recorded as installed. If it is not, deinstallation is terminated.
If a package is required by other installed
packages, apk_delete will list those dependent packages and
refuse to delete the package (unless
the -f
or -r
option is given).
If a pre-deinstall
script exists for the
package, it is executed. It is this script's responsibility
to clean up any additional messy details around the package's
installation, since all apk_delete knows how to do is delete
the files created in the original
distribution. The pre-deinstall
script is
sent though a pipe to sh as
... | sh -s
pkgname-ver
where pkgname-ver
is the
name (with version) of the package in question.
That is equvalent to running
the pre-deinstall
script
with the following arguments:
pre-deinstall pkgname-ver
If the pre-deinstall
script
fails, deinstallation terminates.
Remove itself from appropriate REQUIRED_BY
lists.
Decompress $APK_DBDIR/
pkgname-ver
.tar.gz
.
Remove files and directories listed in
the $APK_DBDIR/
pkgname-ver
/CONTENTS
file.
If the package contains a post-deinstall
file, it
is then executed as
sh post-deinstall
pkgname-ver
where pkgname-ver
is the package
name (with version) in question.
Remove all meta files in
the $APK_DBDIR/
directory that is related
to the package.
APK_DBDIR
Alternative location for the installed package database.
Default is $ROOT/var/db/apk
.
APKTOOLS_CONF
Configuration file for the apk-tools suite.
Default is /etc/apk.conf
.
ROOT
Base directory for apk-tools. It is unset by default which
means that /
is the base directory.