18

I would like to completely uninstall a snap application from my Ubuntu OS.

Usually, I use the command sudo snap remove <app-name>. But I noticed that if I search inside the root folder of my system for <app-name>, there are residues from this program.

The way I access the root directory is through the command sudo nautilus. After accessing nautilus, I select Filesystem root and then search for the <app-name> in the Search bar. Finally, after waiting for all files with the same name as the <app-name> to load on my screen, I delete them manually.

Note: I access nautilus using the command above because super user permission is required to delete program files in the root directory.

My question is:

Is there a way to completely delete everything related to this application with just a few commands via terminal?

Thank you in advance!

  • 5
    have you tried sudo snap remove --purge <package_name> ? – johncli Oct 07 '20 at 19:25
  • 3
  • As I know if your software has configurations files under your home they will not be deleted. And you have to remove it by hand. – Lews Oct 08 '20 at 00:54
  • @user535733 I just access my terminal and type the command sudo nautilus (to have access as an administrator), access the filesystem root, enable the option to show hidden files from the system and type the name of the app in the search bar to find everything related to same. This process is time-consuming and boring. I wish there was a simpler solution. – Yuji Tanaka Oct 18 '20 at 15:20
  • @johncli Yes, I have. But that command doesn't always work. Therefore, I do the procedure that I mentioned above. However, sometimes even this does not work, as the system does not delete everything. So, I usually clean up my Ubuntu OS cache using BleachBit, restart my computer, and the waste disappears. But it all takes time. I wish there was a command line for all of this. – Yuji Tanaka Oct 18 '20 at 15:25
  • @User24601 No, it doesn't. – Yuji Tanaka Oct 18 '20 at 15:26
  • @Lews I once asked the same question for this problem, but involving Flatpak. You can access this question by accessing this link. The answer to my question involving a Flatpak app worked through the commands they suggested to me. I learned more commands and saved my time. – Yuji Tanaka Oct 18 '20 at 15:35
  • The sudo snap remove --purge <package_name worked great to remove the snap package itself, but it did not remove any symlinks in /usr/bin/* and /usr/local/bin/*. I had to remove those manually – user2490003 May 20 '21 at 17:51

1 Answers1

0

You can use a combination of find and rm -r find is a command line program which can find matches of the programs name.

Another approach is to look at the contents of the snap package and determine why/where it might leave residues.

Lastly you can try using apt-get purge to remove references if you accidentally installed via apt as well for snap I would recommend the find/remove pattern if it's caching the snap didn't clean up. You could also reach out to the snap maintainer indicating that snap remove didn't fully remove the package.