How to completely uninstall a package along with dependencies on Arch Linux (as well as BlackArch and Manjaro)
February 18, 2021
This tutorial uses pacman as the package management (uninstallation) program, but you can also use pikaur or yay instead, since the options discussed are the same for all these package managers.
A typical command to uninstall a program that will remove all package files:
sudo pacman -R PACKAGE
Indeed it will remove the specified package, but the configuration files of the package will remain, which will be renamed - the .pacsave extension has been added, and the dependencies that were installed for this package will remain.
To completely remove the program along with all its dependencies and without saving the configuration files, use a command like this:
sudo pacman -Rscun PACKAGE
This command uses the following options:
Remove all target packages, as well as all packages that depend on one or more target packages. This operation is recursive and must be used with caution as it can remove many potentially needed packages.
Instructs pacman to ignore backup configuration files. Usually, when a package is removed from the system, the database checks whether the configuration file should be renamed (the .pacsave extension is appended to it). When using this option, this does not happen - the configuration files are completely deleted.
Removes every specified target, including all its dependencies, provided that: (A) they are not required by other packages; and (B) they were not explicitly installed by the user. This operation is recursive and similar to the reverse --sync operation, and it helps to keep the system clean without orphans. If you want to skip condition (B), write the option twice.
Removes targets that are not required by other packages. This is mostly useful when removing a group without using the -c option to avoid breaking any dependencies.
- How to view package information in Arch Linux (BlackArch, Manjaro) (88.1%)
- Error “cannot resolve dependency lib32 (32-bit library)” (SOLVED) (79%)
- How to simulate package installation on Linux (How to create and install a dummy package) (65.9%)
- pacman error “warning: failed to retrieve some files” (SOLVED) (63.2%)
- Chromium will no longer sync passwords - what should Linux users do? (60.4%)
- Why are channels between 64 and 100 unavailable on 5 GHz Wi-Fi? (SOLVED) (RANDOM - 50%)