How to remove/uninstall any package/application completely from system

I am new in this beautiful OS
But dont know how to uninstall/remove package/applications completely from system…

On windows i use to uninstall the applications and all those reg files and folders from IOBIT uninstaller pro

But here i an unable to delete everything of that specific package

anyone can help me in that ?

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.

4 Likes

Arch has very good documentation available for almost any aspect of the operating system.

E.g. about pacman:
https://wiki.archlinux.org/title/pacman

and in particular about “removing packages”:
https://wiki.archlinux.org/title/pacman#Removing_packages

Another way to do it is using locate, update the database :

systemctl start updatedb.service

or, if like me, you replaced mlocate with plocate :

systemctl start plocate-updatedb.service

then :

locate mozilla

sudo pacman -Rcdns packagename
Be sure to read the output because it can/will delete other packages

This should not be necessary if updatedb.timer is enabled and running, which is the default.

In case you install and uninstall the same day it is needed.

edit: My bad, I’m wrong, it is necessary after any uninstall, so you can search what is left.

1 Like

Hello friend, I am new to EndeavorOS. I was looking at the Arch Rosetta removal commands:

https://wiki.archlinux.org/title/Pacman/Rosetta

And I found your command interesting, it seems to do a different or more complete cleaning?

Could you tell me what exactly this command does and if it is safe to use it?

Thank you!

Please read these pages

Remove Options
https://archlinux.org/pacman/pacman.8.html#RO

https://wiki.archlinux.org/title/pacman#Removing_packages

2 Likes

Omg thank you very much, here I can see what each letter does.

It absolutely isn’t safe.

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.

2 Likes

It’s a part of the pacman manual page, you can access to it in a terminal :

man pacman
1 Like

Thanks a lot, so for now I’ll just use -Rns to uninstall programs.

Omg, I didn’t know there was a command to display the manual, this is really cool, thanks a lot!

Is the man command exclusive to pacman, or can it be applied, for example, to man steam, to view the Steam manual or other programs?

Well, I guess I can try it instead of asking, but I’m always afraid of breaking something. :sweat_smile:

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.

1 Like

If you’re serious then you should start by reading the man manual using the command

man man
1 Like

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.