the small and simple package manager

home : downloads : project :


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:


The named packages are deinstalled where apkname is a package name with or without version number.


If a deinstallation script exist for a given package, do not execute it.


Force removal of the package, even if a dependency is recorded or the pre-deinstall script fails.


Show help and exit.


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.


Quiet mode. Supress non-error messages.


Remove all those packages required by the given packages as well.


Remove all those packages depending on the given packages as well.


Turn on verbose output.


The apk_delete utility runs through the following sequence to deinstall a package:

  1. A check is made to determine if the package is recorded as installed. If it is not, deinstallation is terminated.

  2. 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).

  3. 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.

  4. Remove itself from appropriate REQUIRED_BY lists.

  5. Decompress $APK_DBDIR/pkgname-ver.tar.gz.

  6. Remove files and directories listed in the $APK_DBDIR/pkgname-ver/CONTENTS file.

  7. 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.

  8. Remove all meta files in the $APK_DBDIR/ directory that is related to the package.



Alternative location for the installed package database. Default is $ROOT/var/db/apk.


Configuration file for the apk-tools suite. Default is /etc/apk.conf.


Base directory for apk-tools. It is unset by default which means that / is the base directory.



Default location for the installed package database.


Default location of the apk-tools configuration file.


apk_add (1), apk.conf (5)

SourceForge.net Logo