24

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!

2 Answers2

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.

-1
sudo snap remove --purge $(snap list | awk 'NR>1 {print $1}')

Explanation:

  • snap list: Lists all installed snap packages.
  • awk 'NR>1 {print $1}': Extracts the package names, skipping the header line.
  • sudo snap remove --purge: Removes each package completely, including configuration files.
karel
  • 122,292
  • 133
  • 301
  • 332
amit
  • 9