Package not found

I’m trying to convert my deb app to snap, but there seem to be a missing library.

First, I’m not sure why there would be a missing library because the deb itself works fine.

So anyways I tried adding the library and now I get this error:

Failed to fetch stage packages: Error downloading packages for part 'grapher': The package 'libX11.so.6' was not found.

Here is my snapcraft.yml:

parts:
  grapher:
    # See 'snapcraft plugins'
    plugin: dump
    source: ./grapher_8.4.0-1_amd64.deb
    stage-packages:
    - libX11.so.6

apps:
  grapher:
    command: bin/grapher

Any help is appreciated.

this is not a package name but a file name of a file shipped inside a deb …

you can use apt-file to search for deb package names the file belongs to:

sudo apt install apt-file
...
sudo apt-file update
...
$ apt-file search libX11.so.6
libx11-6: /usr/lib/x86_64-linux-gnu/libX11.so.6
libx11-6: /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
...

before the colon you find the package name to use with your stage-packages

Thanks @ogra
Your solution partially worked although I’m still getting some unexpected runtime error so I may be missing more packages that I don’t know about. While I’m investigating those I have a related question:

Do you know why I would need to include all these packages separately? When I install and run the grapher_8.4.0-1_amd64.deb it works fine so presumable it already includes all the necessary packages. Does snap remove those packages when creating snap and expect us to re-add them via stage-packages?

it likely does not include them but has dependencies that define them …

while snapcraft in its early days simply installed all dependencies of a deb as stage packages, it stopped doing this a while ago.
that way you can for example package an app that normally ships with CLI as well as GUI mode to just be CLI and not ship the libs required for graphical output …

it simply gives the package finer grained control but also adds more work to resolve dependencies manually …

@ogra thank you for that explanation, it makes sense.

I added all the needed packages and now my app can open up. But when it does open the fonts are are messed up and shown as squares. In the logs I see many of these errors and warnings:

Fontconfig warning: "/etc/fonts/fonts.conf", line 5: unknown element "its:rules"
Fontconfig warning: "/etc/fonts/fonts.conf", line 6: unknown element "its:translateRule"
Fontconfig error: "/etc/fonts/fonts.conf", line 6: invalid attribute 'translate'
Fontconfig error: "/etc/fonts/fonts.conf", line 6: invalid attribute 'selector'
Fontconfig error: "/etc/fonts/fonts.conf", line 7: invalid attribute 'xmlns:its'
Fontconfig error: "/etc/fonts/fonts.conf", line 7: invalid attribute 'version'
Fontconfig warning: "/etc/fonts/fonts.conf", line 9: unknown element "description"

I tried adding fontconfig package but that didn’t seem to have any effect.
Any idea what package I’m missing?

try adding the gnome extension (its also brings themes and icons as well as all needed interface plugs along) like:

apps:
  grapher:
    extensions: [ gnome-3-38 ]
    command: bin/grapher

Thanks @ogra you’re a genius. It worked and I can now launch my app successfully.

Next I tried to upload my snap to appstore, but I get “No revision information” error:

$ snapcraft upload --release=stable grapher_8.4_amd64.snap
Preparing to upload 'grapher_8.4_amd64.snap'.
After uploading, the resulting snap revision will be released to 'stable' when it passes the Snap Store review.
Install the review-tools from the Snap Store for enhanced checks before uploading this snap.
Pushing 'grapher_8.4_amd64.snap' [========================================] 100%
Processing...|                                                                  
Ready to release!
Revision 1 of 'grapher' created.
Sorry, an error occurred in Snapcraft:
No revision information for 1

Any ideas what this mean?

try dropping --release=stable, i don’t think you can directly upload to the stable channel, only once uploaded to edge you can release to another channel (like stable)

(I do in fact never actually use snapcraft myself to upload, all my snaps have a github tree set up in https://snapcraft.io/<snapname>/builds so i only commit changes after a local build and then release the auto-built snap to stable later (after a bit of testing))

@ogra Looks like that error was just a warning that always happens the first time you upload. When I looked it up the app was uploaded and accessible via website. Even without stable flag it works. But to release it to app store I had to use stable flag.

Next I have a question about how Ubunut Appstore works. I can now find my app in Appstore and click on install button to install. But after the installation is complete I cannot find the program anywhere. No shortcut is created in Applications panel and searching for app name won’t find it either. I’m not familiar with linux, I assumed just like Windows and Mac appstore, a shortcut is added to list of apps, no?

1 Like

you need to create that shortcut first by creating a snap/gui/directory and putting a .desktop file and an icon into it … i just described this in my latest blog post this week:

(right below the test-pattern screenshot if you scroll down…)