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) (100%)
- pacman error “warning: failed to retrieve some files” (SOLVED) (69%)
- Error “ruby-bundler: /usr/share/man/man5/gemfile.5.gz exists in filesystem (owned by ruby)” (SOLVED) (65.2%)
- Chromium will no longer sync passwords - what should Linux users do? (64.1%)
- Analogue of the --force option in pacman (62.1%)
- How to know when the ext4/ext3/ext2 filesystem was created and when it was last mounted (RANDOM - 50%)