LinuxCommandLibrary

pkgrm

Remove software packages from the system

TLDR

Remove an installed package

$ pkgrm [package]
copy

SYNOPSIS

pkgrm [-n] [-a admin] [-R root_path] [pkginst...]

Where:
pkginst refers to the package instance name (e.g., SUNWcadap). Multiple instances can be specified. If no pkginst is provided, pkgrm will list all installed packages and prompt for which ones to remove.

PARAMETERS

-n
    No execution. Displays what would be removed without actually performing the removal. Useful for testing.

-a admin
    Specifies an administrative file. This file contains parameters that define how pkgrm should behave, such as suppressing prompts or handling conflicts.

-R root_path
    Specifies an alternate root path. Useful for removing packages from an unmounted system or alternate root environment.

pkginst
    The unique instance name(s) of the package(s) to be removed. If omitted, an interactive list of installed packages is presented.

DESCRIPTION

pkgrm is a command-line utility used to remove or uninstall software packages from a system that utilizes the System V Release 4 (SVR4) package management format. It is the counterpart to pkgadd (package add) and manages the process of deleting installed software, including associated files, directories, and configuration settings. When executed, pkgrm can perform pre-removal and post-removal scripts defined within the package, ensuring a clean uninstallation. It updates the system's package database to reflect the removal, making the package no longer visible via pkginfo. This command is crucial for maintaining system integrity and managing installed software on traditional Unix-like operating systems such as Solaris, HP-UX, and older Linux distributions that adhered to SVR4 packaging standards. It often requires superuser privileges to execute successfully.

CAVEATS

pkgrm is primarily associated with System V Release 4 (SVR4) package management. It is not commonly used on most modern Linux distributions (e.g., Debian, Ubuntu, Fedora, CentOS), which utilize different packaging systems like APT (Debian/Ubuntu), RPM (Fedora/CentOS), or DNF/YUM. Users on these systems should typically use their respective package managers (e.g., apt remove, yum remove, dnf remove, rpm -e, dpkg -r). Executing pkgrm generally requires superuser (root) privileges.

INTERACTIVE MODE

If no pkginst is specified on the command line, pkgrm will enter an interactive mode. It will list all currently installed packages and prompt the user to select which packages to remove, requiring confirmation for each removal. This mode is useful when you are unsure of the exact package name or want to browse available uninstall options.

ADMINISTRATIVE FILES

Administrative files, specified with the -a option, provide a non-interactive way to control pkgrm's behavior. They can define responses to prompts (e.g., 'yes' or 'no' for confirmations) and control error handling, making them useful for automated script-based package removals.

HISTORY

The pkgrm command is an integral part of the System V Release 4 (SVR4) package management system, which was developed by AT&T in the late 1980s and early 1990s. This system was designed to standardize software installation and removal across various Unix platforms. While its influence can be seen in later package management systems, pkgrm itself is now primarily found on traditional Unix-like operating systems such as Oracle Solaris, HP-UX, and older versions of SCO Unixware, rather than mainstream Linux distributions that have adopted their own, more modern packaging formats.

SEE ALSO

pkgadd(1M), pkginfo(1), pkgchk(1), installf(1M), removef(1M)

Copied to clipboard