Snap: No such file or directory

Hey All,

I am having a weird issue with core18 based snaps. The post-refresh script uses snap get <another-package> to perform some post installation checks. The hook perfectly fine when using the base core but fails with snap: No such file or directory when installing the snap with base core18 . There is no other change except the change in the base in snapcraft.yaml. Any idea what could be going wrong ? I even tried adding the full path /usr/bin/snap in the post-refresh script to see if it works with out any success.

Sanjay

The snap command should not be used from inside snaps, it is not allowed by the security policy generated by snapd, is your snap perhaps in devmode?

Yes, it is in devmode . So starting from CORE18 we can not use snap command in devmode as well ? What would be the better way to get information about other snaps in that case ?

the only clean way to manage snaps or get info about other snaps is the snapd API which you can access through the snapd-control interface, but snaps with this interface are restricted to brand stores, you wont be able to upload such a snap to the global snap store.

1 Like