apk-tools

the small and simple package manager

home : downloads : project :

Name

apk_delete — a utility for deleting previously installed software packages

Synopsis

apk_delete [-DfhnpqRrv] [-p prefix] apkname ...

DESCRIPTION

The apk_delete command is used to delete packages that have been previously installed with the apk_add command.

WARNING

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.

OPTIONS

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.

TECHNICAL DETAILS

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.

ENVIRONMENT

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.

FILES

$ROOT/var/db/apk

Default location for the installed package database.

/etc/apk.conf

Default location of the apk-tools configuration file.

SEE ALSO

apk_add (1), apk.conf (5)

SourceForge.net Logo