pkgrm
Remove software packages from the system
TLDR
Remove an installed package
SYNOPSIS
pkgrm [-n] [-a admin_file] pkginst [pkginst...]
PARAMETERS
-n
Non-interactive mode. Removes the package without prompting for confirmation. Requires an administration file via the -a option.
-a admin_file
Uses admin_file instead of the default administration file. The admin file provides instructions and settings to the pkgrm command, specifically when running non-interactively (-n).
pkginst
Specifies the package instance(s) to be removed. Multiple package instances can be specified.
DESCRIPTION
The pkgrm command is a utility used to remove previously installed software packages from a Solaris-based or other Unix-like system. It provides a relatively standardized way to uninstall software, ensuring that files and directories associated with the package are removed, and that system configuration files (like /etc/vfstab) are updated accordingly.
When executed, pkgrm typically prompts the user for confirmation before removing the package. It also handles dependencies between packages. If a package being removed is required by another package, pkgrm may refuse to proceed unless explicitly overridden. The command reads package information files to determine which files and directories belong to the package and takes the necessary steps to remove them. It uses scripts defined in the package itself to handle any special cleanup or configuration adjustments needed during the uninstallation process.
It's important to run pkgrm as the superuser (root) or with appropriate privileges, as it needs to modify system-level files and directories.
CAVEATS
pkgrm is primarily associated with older Solaris and System V Release 4 (SVR4) based systems. Modern Linux distributions typically use package managers like apt, yum/dnf, or pacman, which provide more advanced dependency management and rollback capabilities. Using pkgrm on systems with those package managers is not generally supported or recommended.
ADMINISTRATION FILE
The administration file used with the -a option defines how pkgrm should behave in non-interactive mode. It can specify default responses to prompts, control logging, and manage other aspects of the removal process. Carefully crafted admin files are crucial for automated or unattended package removals.