Core18 "classic" snap can't be installed via the UI on 16.04 - how to build one that can?


#1

How do I build a core18 based snap which can be installed via the UI on all Ubuntu’s 16.04 and over? Isn’t that the main point of snaps? Is it possible?

Following the tutorial I successfully built a core18 app (see my snapcraft.yaml) it pushed ok to the store and I was able to install it on another Ubuntu 18.04 system OK. But trying to install it on a Ubuntu 16.04 system via the UI failed. I got the dreaded snapd returned status code 400: Bad Request error using the Software Centre, which apparently is because I have built a “classic” snap which can’t be installed via the UI.

Seriously? I followed the snapcraft tutorial instructions.
How do I build a more general snap which can be installed via the UI on all Ubuntu’s 16.04 and over?

P.S. I could successfully install on 16.04 using the command line sudo snap install andy-testsnap-py --edge but my users want to use the software centre to install software - not use a command line.


#2

that’s not a classic snap


#3

how do you get this error? (I’m not getting anything)


#4

I run Ubuntu 16.04, visit https://snapcraft.io/andy-testsnap-py and click on the link to install.

It asks me if I want to use software centre, I say yes. In the Ubuntu software centre I click the install button. Then the status code 400 error appears.


#5

I don’t get a 400, but I do get a 404:

Detailed errors from the package manager follow:
snapd returned status code 404: Not Found

looking at what’s going on in a bit more detail, it looks like the software centre is not passing the channel on to snapd. This sounds like a bug, but it might be just that it’s not supported yet (and the bug is in the website expecting it to work) @robert.ancell ?

Having said this, how do you get the 400? Could you share the full message? Because you’re hitting some other issue.


#6

I get the 400 message as I described in the steps above. I’ll redo the steps tonight to make sure I’m not missing anything. Anyway, its the same message referred to by many existing posts:




I guess I’m confused on multiple fronts

  1. I followed the tutorial and installed sudo snap install skype --classic - does that mean I am generating classic apps which can’t be installed on older 16.04?
  2. I added the recommended core18 directive - does that have any impact on things?
  3. I simply want an app in the snapcraft store that installs on both 16.04 and 18.04 with a great user experience of click - install - done via the software centre. Is this possible? Surely this is the promise of snap?

Apologies in advance if I have missed something fundamental…


#7

Is this the same issue as you mentioned in the other thread here?

In that case, the main difference was that 16.04 had an old version of snapd (2.34, since the newer 2.37 is stuck in proposed). And since installing a core18 based snap does not trigger installation of core, you don’t get the newer snapd delivered via that snap.

When the newer snapd is promoted from xenial-proposed things will likely sort themselves out, but in the mean time running snap install core should work around the problem.

Perhaps this should increase the priority of getting the new snapd pushed out to xenial users?


#8

@jamesh Yes its the same app I’m trying to test and install. Thanks for your explanation of what is going on. Hopefully the xenial approval of the later snapd will happen soon.

@chipaca I re-tested on a 16.04 which now has both core and core18, removed my app with snap remove andy-testsnap-py and then visited my snapstore link, opened in the Ubuntu Software app, clicked Install and got snapd returned status code 404: Not Found like you did. Will the new xenial snapd we are waiting for solve this too?


#9

The xenial-proposed build can also be found here:

https://launchpad.net/ubuntu/+source/snapd/2.37.4/+build/16445352

Downloading snapd_2.37.4_amd64.deb from there and installing that with sudi dpkg -i should let you check whether it fixes the problem.


#10

unless there is also an updated gnome-software that asks for the right channel, no.