LinuxCommandLibrary

xbps-remove

Remove installed packages

TLDR

Remove a package

$ xbps-remove [package]
copy

Remove a package and its dependencies
$ xbps-remove [[-R|--recursive]] [package]
copy

Remove orphan packages (installed as dependencies but no longer required by any package)
$ xbps-remove [[-o|--remove-orphans]]
copy

Remove obsolete packages from the cache
$ xbps-remove [[-O|--clean-cache]]
copy

SYNOPSIS

xbps-remove [options] [pkgname ...]

PARAMETERS

-d
    Perform a dry-run: show what would be removed without actually removing anything. Useful for previewing changes.

-f
    Force removal of the package. Can be used to bypass certain checks or remove packages that are otherwise difficult to remove.

-n
    Do not ask for confirmation; assume 'yes' to all prompts during the removal process. Use with caution.

-R
    Remove recursively. This option removes the specified package(s) and all its dependencies that are no longer needed by any other installed package on the system.

-o
    Remove orphaned packages. This specifically targets packages that are installed but no longer required as a dependency by any other manually installed package.

-O
    Remove orphaned packages but do not remove their configuration files. Useful for preserving settings for potential future installations.

-r rootdir
    Perform the operation within the specified root directory, allowing for package management in an alternative root filesystem.

-v
    Enable verbose output, providing more detailed information about the removal process.

DESCRIPTION

xbps-remove is a powerful command-line utility within the XBPS (X Binary Package System), the default package manager for Void Linux. Its primary function is to uninstall previously installed software packages from the system. It intelligently handles package dependencies, allowing users to remove not only specified packages but also their no-longer-needed dependencies (often referred to as orphaned packages) through specific options like
-R or -o.

The command interacts directly with the local package database to ensure system consistency and accurate dependency tracking. It is an essential tool for system maintenance, freeing up disk space, and managing the installed software base efficiently in Void Linux environments. Users typically invoke it with one or more package names, providing a straightforward way to keep their systems clean and optimized.

CAVEATS

Removing essential system packages can severely compromise or render your Void Linux system unbootable. Always exercise caution, especially when using options like
-f (force) or -R (recursive removal). It's recommended to understand the implications of removing dependencies before proceeding. Configuration files for removed packages are often left behind by default unless specific options like
-O are used for orphaned packages, or manual cleanup is performed.

ORPHANED PACKAGES AND SYSTEM CLEANUP

An orphaned package is a package that was installed as a dependency of another package, but the original package has since been removed, leaving the dependency no longer required by any active application. The
-o option of xbps-remove is specifically designed to identify and remove these orphaned packages, which is crucial for maintaining a lean system and freeing up disk space over time. The
-R option extends this by also removing dependencies of a specified package that become orphaned after its removal.

HANDLING CONFIGURATION FILES

By default, when a package is removed with xbps-remove, its configuration files are often left on the system. This behavior is intentional, allowing users to retain their settings should they decide to reinstall the package later, or to manually clean them up if desired. For orphaned packages, the
-O option provides a way to remove the package while explicitly preserving its configuration files, offering flexibility in system cleanup strategies.

HISTORY

xbps-remove is an integral part of the XBPS (X Binary Package System), which was initially developed by Juan Romero Pardines. XBPS was designed from the ground up for simplicity, speed, and robustness, becoming the core package manager for Void Linux. xbps-remove's design reflects these principles, providing a straightforward yet powerful utility for managing package removals and maintaining system cleanliness, evolving alongside the XBPS project itself since its inception.

SEE ALSO

xbps(8), xbps-install(8), xbps-query(8), xbps-alternatives(8), xbps-pkgdb(8), xbps-autoremove(8)

Copied to clipboard