REMOVEPKG(8)

NAME
removepkg - remove Slackware and Zenwalk packages.

SYNOPSIS
removepkg [ [--warn|-w] | [--raw|-R|--verbose|-v] | [--no-verbose|-q] | [--ask|-a] ] [ [--unique|-u] | [--remove-all|-A] ] [--root /otherroort | -r /otherroot] [--max number | -m /number] [--list number | -l number] [--fast|-f] [--] [/]packagename [ [/]packagename2 ... ]

DESCRIPTION
removepkg removes previously installed Slackware and Zenwalk packages. A package may be specified either by the full package name (as you'd see listed in /var/log/packages/), or by the base package name.For example, the package foo-1.0-i386-1.tgz may be removed with any of the following commands: removepkg foo-1.0-i386-1.tgz removepkg foo-1.0-i386-1 removepkg foo.tgz removepkg foo In the last two forms, if different versions of same package are installed, only one of them will be removed.This behaviour can be modified by using --remove-all or --unique (see OPTIONS below) If the name of package begins with a "/" then the package name is treated as an extended glob pattern and expanded to match all installed filenames in the package database in the root directory(see GLOBBING below )

When deleting files, removepkg analyzes the contents of the other packages installed on your system, and only deletes the files that are unique to the package being removed. Similarly, the installation scripts for all the other packages will be considered when deciding whether or not to delete symbolic links from the package.

Removing a package (as well as installing one) can be a dangerous undertaking. For this reason, there is the --warn option available. When you use this, removepkg will not actually remove any files or links, but will output a detailed report of what it would do if you actually did remove the package. It's suggested that you do this (and maybe pipe the output to less ) before removing packages to make sure you've backed up anything that might be important.

When removing a package, its original file index will be moved from /var/log/packages to /var/log/removed_packages. Likewise, its installation script will be moved from /var/log/scripts to /var/log/removed_scripts.

OPTIONS

-w, --warn
    Turn on the warn mode(see MODES below)Generate a report to the standard output about which files and directories would be removed, but do not actually remove the package.

-v, --verbose,-r,--raw
    Turn on the raw mode(see MODES below)List all the files being removed. Normally only warnings and errors are shown, e.g. if some files were not found.

-V,--no-verbose
    Turn on the no-verbose mode (see MODES below).Hide all messages and display only a summary of error,if any, for each package on standard error after removepkg has processed all the packages.
-r /otherroort ,--root /otherroot
    Remove the packages from a location other than / (the default) as the root of the filesystem. Setting the ROOT environment variable does the same thing.

-a,--ask
    Turn on the interactive mode(see MODES below),clear the screen and ask user to choose among installed packages matching given package names to be removed

-A,--remove-all
    remove all the installed packages matching a given packagename if the number of packages is less than maximum removal of packages allowed( see -m number , --max number )

-u,--unique
    do not remove any matched packages and report error if the given packagename
     matches more than one package installed. .B removepkg continues to process next given to it as argument
-m  number , --max number
    set the maximum number of matches allowed to be removed for a given packagename .In case the number of packages matching a given packagename is greater than number then if --remove-all or -- ask or both were specified then .B removepkg doesnot remove or ask the user to select the packages and continues to next package. number can be any integer greater than or equal to 0.if number is 0 , then the maximum limit of matched packages allowed to be removed is infinity, that is any number of matches are allowed. By default number is set to 10.
--list number , -l number
    Set the number of packages to list in ask mode ( see MODES below) for selection in case more than one package matches the given packagename

--fast, -f
    Do not create backups while removing files thereby making removepkg a little faster, use of this option is not advisable

GLOBBING
if a packagename begins with a "/" it is interprated as an extended glob pattern( as defined in bash(1) ) by removepkg. There can only be one such glob pattern but more than one pattern can be used by nesting it inside the first pattern.In the following description, a pattern-list is a list of one or more patterns separated
 by a |. Composite patterns may be formed using one or more of the following sub-patterns:

?(pattern-list)
    Matches zero or one occurrence of the given patterns

*(pattern-list)
    Matches zero or more occurrences of the given patterns

+(pattern-list)
    Matches one or more occurrences of the given patterns

@(pattern-list)
    Matches one of the given patterns

!(pattern-list)
    Matches anything except one of the given patterns removepkg searches for the occurence of one of above pattern constructs from left after the first "/" and uses the first occurence of the pattern as extended glob pattern, rest of the patterns, if any, that aren't nested inside the first pattern are used literally and not treated as glob.If no such glob patterns are found in the word after "/", removepkg tries to look for all the installed packages whose name begin with the given word. For example, removepkg '/foo' is treated same as the globbing pattern 'foo*' by removepkg. Please note that globbing patterns are not treated as glob unless they are inside one of the extended globbing constructs described above.Thus, removepkg '/@(foo*)' , removepkg '/foo@(*)' and removepkg '/foo' are all the same where all installed packages whose name begins with foo will be removed depending on other options used. removepkg '/foo*' is not the same as above as in this case packages whose names begin with 'foo' followed by a literal '*' are matched.

MODES
removepkg functions in various modes which are mutually exclusive.These modes control the behaviour of removepkg such as the output produced by it, the action taken for each package,etc

  SPIN MODE
This is the default mode.In this mode, removepkg removes packages producing only limited output and errors and shows a spinning bar while waiting for processes to complete.Files being skipped as they are part of another package are displayed on standard error. in the beggining of the message

  WARN MODE
This mode is turned on by --warn or -w option.In this mode, packages are not removed but a list of files and symlinks that will be removed or skipped for each package is printed on standard output.Each file and symlink is preceded by words that represent the fate of the file or symlink if removepkg would be called for those packages in any other mode other than warn mode The output is of the format words : filename words can be

**REMOVED-DIR(IF-EMPTY)
    The directory will be removed if it is empty

**REMOVED-FILE
    The file is unique to the package and shall be removed

SKIPPED-FILE(NON-EXISTENT)
    The file doesnot exist and cannot be removed

SKIPPED-FILE(REQUIRED)
     The file is not unique to the package and is required by another package and will not be removed

SKIPPED-FILE(NON-EXISTENT/REQUIRED)
    The file is required by another package and doesnot exist and cannot be removed

**REMOVED-SYMLINK
    The symlink is unique to the package will be removed

SKIPPED-SYMLINK(NON-EXISTENT)
    The symlink doesnot exist and can not be removed

SKIPPED-SYMLINK(REQUIRED)
     The symlink is not unique to the package and is required by another package and will not be removed

  ASK MODE
this mode is turned on by --ask or -a. This is interactive mode where screen is saved and cleared.A progress bar for number of packages removed or processed is displayed. removepkg asks user to select matched packages if the number of matched packages is more than one and less than maximum allowed ( see -m number , --max number ).Before removing selected packages , user is prompted to confirm.This mode is advised to be used especially while using globbing patterns (see GLOBBING above)

  RAW MODE
This mode is turned on by --raw,-r or --verbose,-v. This mode turns off the display of spinning bar and also lists all the files being removed.

  QUIET MODE
This mode is turned on by --no-verbose,-V. All the messages are suppessed and only a summary of error messages are displayed after all packages have been processed (see ERROR REPORT below)

ENVIRONMENT

ROOT
    Setting this is equivalent to using the --root /otherroot command line parameter.

SOURCE
    define a different location for source scripts and other files required by removepkg, default is /usr/libexec/zenpakt

USERPATH
    Add preffered search path for commands. It is a colon-separated list of directories in which removepkg will look for commands in addition to other usual directories which are internally defined.By default removepkg looks in /bin,/sbin,/usr/bin,/usr/sbin,/usr/local/bin,/usr/local/sbin. A zero-length (null) directory name in the value of USERPATH indicates the current directory.

EXIT STATUS
removepkg can remove more than one package at a time.The exit status is zero unless their is a preprocessing error or an error while processing a package. Preprocessing errors occur before any package is processed and cause removepkg to exit immediately without processing any package with a non zero exit status.An error while processing a package causes removepkg to jump to next package.The error is reported on standard error unless quiet mode is not enabled.A summary of error messages is reported on standard error after processing all packages (see ERROR REPORT below).The exit status is set corresponding to the last error occured while processing a package.The exit statuses are given below

    •   1 failed to source functions.The functions file doesnot exist at a place where removepkg expects to find it

    •   2 you are not root

    •   3 invalid arguments specified

    •   4 tar not found in PATH

    •   5 database locked by another process

    •   7 failed to create temporary directory

    •   8 package database doesnot exist

    •   9 comm not found in PATH

    •   10 interactive mode needs standard input connected to the terminal

    •   11 interactive mode needs standard output connected to the terminal

    •   12 interactive mode needs standard error connected to the terminal

    •   13 external compression utility missing

    •   30 no such package

    •   31 found more than one installed package matching the given name

    •   32 list of installed packages matching the given name exceeds the maximum removals allowed

    •   33 no packages selected

    •   61 failed to extract install/

    •   62 failed to fetch file list for installed packages

    •   63 error removing files

    •   64 failed to write removed package databse entry

    •   65 failed to move doinst script

ERROR REPORT
removepkg can take multiple package names as argument and thus remove multiple packages when called once.The errors occuring in processing one package causes removepkg to jump to the next package argument.An error message is displayed if removepkg is not in quiet mode ( see MODES above).In all modes, except warn mode, a summary or report of errors occured for each package is displayed after all package have been processed. The error report is generally of the format:

packagename: error_status ( error_message )

packagename is name of the package, error_status is the exit or error status related to the error that occured while processing the package, and error_message is a short message explaining the error that had occured

EXAMPLES

removepkg -Am 0 /python-
    removes all packages whose name start with python

removepkg -u '/bash-@(4.*-*-*)'
    removes bash package with major version 4 without specifying architecture and build only if a single package matches the pattern

removepkg -ar /home/me/test -m 0 '/@(b*|d*)'
    list all packages installed at /home/me/test as root whose name begin with 'b' or 'd' and ask the user to select the packages to be removed

BUGS
removepkg extracts symbolic links for packages from their doinst scripts

AUTHORS
Anshul Narula <sunny_delhi18@yahoo.com>

SEE ALSO
installpkg(8), removepkg(8), upgradepkg(8), explodepkg(1), makepkg(1)