Today I was experimenting with this. I decided to make a snap of my library. My snapcraft.yaml looks like this:

name: inverse
version: "4.1"
summary: [insert summary here]
descrption: [insert short desc here]
  [insert long desc here]
confinement: devmode

    plugin: cmake
    source: https://github.com/InitializeSahib/Inverse/archive/v4.1.tar.gz

I create the archive with snapcraft, then install it with sudo snap install --devmode inverse_4.1_amd64.snap.
The problem is, I can't use it.
After basic inspection, I've come to this:

/snap (contains the inverse snap [headers and shared objects])
/usr/local/lib, /lib, /usr/lib (nothing in here)
/usr/local/include, /usr/include (nothing in here either)

No surprise that g++ flops when I'm trying to use it:

g++: fatal error: inverse/InverseRandom.h: no such file or directory
g++: compilation terminated

I've set confinement to the lowest level (devmode), so, my question is: is it even possible to have a shared library in a snap?

Some system information:

Ubuntu GNOME 16.04 (fresh installation, less than a week old)
Snapcraft version 2.13.1

  • Great fist question! Welcome to Ask Ubuntu!
    – grooveplex
    Commented Aug 5, 2016 at 7:04
  • @grrooveplex I've been here a long time but thanks Commented Aug 5, 2016 at 17:11
  • I see! Still: good question.
    – grooveplex
    Commented Aug 5, 2016 at 17:12
  • 1
    What are you trying to achieve? Is the goal to ship the library as a snap with lib and headers so that others can build things on top of it? If yes, this might not be the best approach. Snaps are for shipping apps and services. If something builds on top of your library, they could ship it as a part of their app, or they could bundle the .so files from a package in a PPA or the Ubuntu archive. If your use-case is different, please elaborate.
    – dholbach
    Commented Sep 21, 2016 at 6:59

1 Answer 1


Snap primary target is the packaging of apps as full bundle to run in an isolated container. So it is not suitable for shared libraries, plugins, modules, OS themes...

You may offer as Debian package from PPA or Official archive. Even as source archive, app developers can build your library in same tree for their snap.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .