This depends on what you mean by “everything.” By default, when you uninstall a package with pacman, all the files owned by that package will be removed from the system. You can check the list of files owned by a package with this command:
pacman -Ql <package>
For example,
pacman -Ql firefox
will list out all the files owned by the firefox package.
To remove a package along with its dependencies, run
sudo pacman -Rn <package>
Note, however, that user configuration files (usually the files inside ~/.config directory) associated with that package will not be removed. Cache files (stuff inside ~/.cache) as well as program data files (files inside ~/.local/share and /var/lib) will be left untouched. Basically, pacman will not touch any files associated with the removed package if those files reside in the user’s home directory. So if you want them gone, you are going to have to remove them manually.
You can locate any leftover files from a package with the find command + a glob pattern with the package’s name. For example, let’s say you just uninstalled firefox and you want to find out the leftover files associated with firefox:
sudo find / -wholename "*mozilla*"
And/Or
sudo find / -wholename "*firefox*"
Caution: Be careful when attempting to delete files (especially system files that are not in your home directory) on your system. Make sure you know what exactly what you’re deleting before proceeding. You have been warned.
Never combine -Rc and -Rs unless you are trying to purge large parts of your system. That removes packages recursively in both directions. It will almost always remove too much.
Also, never use -Rd unless you really know what you are doing and have a specific reason to do so. That can leave you in a broken state pretty easily.
It works with most of the system commands, it’s different with applications, some provide a man page or an help option (command --help) and others none.
Thank you very much friends. I left Windows recently and although I have learned a lot about Linux in the last month, there are still really basic things that I don’t know.