57

After a snap has been installed with sudo snap install [package] how can I list the files which have been installed by the snap?

Kalle Richter
  • 6,180
  • 21
  • 70
  • 103

3 Answers3

49

Snaps are compressed squashfs files, which typically get 'installed' to /var/lib/snapd/snaps. So if you snap install ohmygiraffe you'll find a file called /var/lib/snapd/snaps/ohmygiraffe_3.snap.

If you'd never installed a snap before then you'll also have a core snap which lives at the same location.

If you're interested in seeing what's inside that snap, look in /snap/<snapname>/<current>/. Note that you're peering into the snap, the contents aren't unpacked onto your filesystem.

The only other thing you'll find is a .desktop file in /var/lib/snapd/desktop/applications.

Once your snap has been run, you may also find data in ~/snap/<snapname>.

popey
  • 23,667
16

Snaps are standalone squashfs images, which means listing what they install is as simple as listing the contents of the image. These images get mounted into place at /snap/<snapname>/<snap revision>, although you can just use /snap/<snapname>/current for the currently-active revision, e.g.:

$ ls -lR /snap/<snapname>/current/
kyrofa
  • 7,346
  • 1
  • 32
  • 26
2

If you don't have root and/or want to look at a package that isn't installed and so isn't in /var/lib/snapd/snaps, you can use

cd /some/dir/for/storing/snaps/
mkdir snapname
cd snapname/
snap download snapname
unsquashfs -l *.snap

where snapname is the name of some snap.

unsquashfs may be installed with sudo apt install squashfs-tools

  • Replacing snapname by feh-lreenaers I get cannot download snap "feh-lreenaers": no snap revision available as specified ; using feh-lreenaers_1 instead I get internal error: unsupported download with instance name "feh-lreenaers_1" – user2987828 Sep 20 '21 at 14:19
  • snap info indicates there is no stable version as I write this. Try the --candidate flag (or whatever other version you want to try). See snap help download – Russell Jones Sep 20 '21 at 18:16