Command Line - Proper way to Remove Packages installed using AUR, GitHub and makepkg si -?

I am a Linux user for over 10 years now and have left Debian behind. I have either Arch or Manjaro on all my PC’s and am especially enjoying Manjaro. Re: package install - I have pamac of course, but I often install packages from the AUR using the command line, git clone and makepkg -si method. This works perfectly and seems to always install the package binaries in /usr/bin which makes sense. If I decide to uninstall that package - what is the proper method? Using sudo rm -R doesn’t seem to work - even when in /usr/bin - also, I expect many packages and dependencies could be missed. Is there a way to purge everything I previously installed? I prefer to use the command line to do this if possible. Thanks.

AUR: sudo pacman -Rsn <package name>
makepkg: sudo pacman -Rsn <package name>
Github: The git repo should contain uninstall options.

2 Likes

As I said, I tried sudo pacman -R and got the message 'target not found. This command didn’t work even in /usr/bin where I could see the minetest files. I will do as you suggest and look in the git repo for uninstall instructions.

So you didn’t install it via AUR or makepkg. Then you need to see the git repo that contains the build files for uninstallation instructions as that varies from project to project.

If you did build it from a PKGBUILD file, please look at the PKGBUILD file for the pkgname. That’s what you need to pass to pacman when removing it.

2 Likes

I DID install from AUR and DID use makepkg -si - so there was a PKGBUILD - name ‘minetest’ - but this method didn’t work. I’ve since removed the files with the GUI and sudo priveleges, then used Timeshift so I’ve cleared it out that way. I have had success with sudo pacman -R previously - I was surprised it didn’t work in this case, hence my question if there’s another method.

minetest package is from the regular repository, not the AUR.

So that can be removed with sudo pacman -Rsn minetest. If that says package not found, then you didn’t have it installed.

I saw later that I could have used pamac - it is indeed in the regular repository but I didn’t realize that until after installing it from AUR. So I could have easily removed it that way (with pamac). It WAS definitely installed because I was playing it. What is the -Rsn argument as opposed to the usual -R? Thanks for your time.

-Rsn removes the package, the dependencies not needed by other packages and it’s configuration files in /etc (supposedly).

If there are still remnants of the package around, the best way to remove those is to re-install the package and remove it, like:

sudo pacman -S minetest --overwrite "*"
sudo pacman -Rsn minetest

This will re-install the package, making pacman aware of the files that where left behind, and then remove it with those files.

1 Like

I am going to do that - just for the education. This is what I was after - as deep an understanding of the entire process as possible. Thanks very much - best regards to you and Denmark!

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.