Error installing "core" snap: fails to mount and setup

I installed snapd via

sudo apt-get install snapd

It fails to connect to the sever, unless I execute as this:

sudo /usr/bin/snapd/snapd

Once that is done, in another terminal window, I can login successfully.

I can find snaps and generally browse what is available. However, when I try to snap install something, the “core” packages is fetched first (whether I am trying to install okular or hello-world) and the following roor appears:

error: cannot perform the following tasks: 
- Mount snap "core" (2381) (internal error: could not unmarshal state entry "snap-type": invalid snap type: "")
- Setup snap "core" (2381) security profiles (cannot find installed snap "core" at revision 2381)

Any ideas?

I am running Ubuntu 16.04 xenial on a Chromebook via crouton.

Hey @ramiroau,

Thanks for your problem report. Can you please paste the output of: snap version ? Also apt list snapd please?

Thanks you,

Isn’t crouton actually a chroot ? if so, there wont be a running systemd, will there ?

(i also doubt the chromebook default kernel is properly providing apparmor and seccomp as needed for snaps)

Yes, of course.

snap version 
snap 2.2.5
snapd unavailable
series - 

Once snapd is activated through sudo /usr/lib/snapd/snapd the outcome is diferent!

snapd 2.25
snapd 2.25
series 16
ubuntu 16.04
kernel 3.18.0-14873-g6d9f3996159a

As far as I understand, the crouton is indeed a chroot (and for what I gather, my kernel seems rather old). Thanks so much.

@ramiroau Have you found the solution? I’m also on a ChromeBook on Xenial via crouton…
I have the same problem

@mvo You haven’t replied…

Currently you need to have systemd (not necessarily as pid 1; see how we make it work in 14.04) and a newer kernel (I don’t know exactly the minimum, but I do know that 3.18 is EOL for nearly a year already; having said that it’s possible somebody’s backported all the bits, but I don’t know) for snapd to work.

And that’s without looking into running it properly confined, which a chroot is going to make difficult.

I could not find a solution. Chipaca’s answer, though, seems correct. It has to do with the kernel version. Eventually, I was able to install the new version of Okular in a different way and abandoned the attempt to install snapd all together.