Installing snap on Fedora


#1

Snap can be installed on Fedora from the command line:

$ sudo dnf install snapd

Either log out and back in again, or restart your system, to ensure snap’s paths are updated correctly.

To enable classic snap support, enter the following to create a symbolic link between /var/lib/snapd/snap and /snap:

$ sudo ln -s /var/lib/snapd/snap /snap

Either log out and back in again, or restart your system, to ensure snap’s paths are updated correctly.

To test your system, install the hello-world snap and make sure it runs correctly:

$ sudo snap install hello-world
hello-world 6.3 from Canonical✓ installed
$ hello-world
Hello World!

Snap is now installed and ready to go! If you’re using a desktop, a great next step is to install the Snap Store app.

:warning: Fedora Silverblue implements a read-only root filesystem and, consequently, cannot allow the above symbolic link to be created. See the following associated GitHub issue for further details: Make it easier to link in or bind folders to root directory?


Installing snapd
#2

Do these instructions work for CentOS and RHEL? If so, can we update the relevant links and commentary accordingly? If not, can we add instructions for those two distributions, please?


#3

These instructions do not work for CentOS/RHEL, but there will be a documentation page for that distribution family as soon as @mborzecki and I get everything squared away.

For now, the instructions are in the updates topic for snapd for CentOS/RHEL.


#4

I tried this on Silverblue and it didn’t work.

It uses ostree to manage system data and has a read only root.

I think the easiest way to do this would be to add a bind mount to the fstab or use a systemd mount file but when I tried this I ended up causing my system to fail to boot so I didn’t want to mess around after I recovered.

Edit:

I made a ticket for rpm-ostree to see if this sort of thing can be easier https://github.com/projectatomic/rpm-ostree/issues/1711


#5

Thanks for letting us know, and for creating the ticket. I’ll add a note about Fedora Silverblue while we look into possible solutions.


#6

After running

$ sudo dnf install snapd

the user is required to log out and log in again for the system to pick up the new $PATH. Else it is not possible to start snap apps via GNOME dash for example.

Might be obvious to some users, but took me the better part of an hour to figure it out. Maybe worthy to note it in the install docs.


#7

Thanks for letting us know, and sorry for the omission. We’ll add this to the docs.


#8

Logging out and logging back in is required for every distribution that doesn’t preload snapd for the binaries and stuff to work, since they don’t take effect until the profile is reloaded.


#9

When I run sudo snap install hello-world

I get error error: system does not fully support snapd: cannot mount squashfs image using "squashfs": mount: /tmp/sanity-mountpoint-620885772: unknown filesystem type 'squashfs'.


#10

Hello - I’ve just tested this with a fresh install of Fedora 29 (workstation installation) and it worked as expected for me. Could you let us know which version of Fedora you’re running?


#11

Fedora release 28 (Twenty Eight)


#12

Thanks - I’ve just tried the same thing with 28 and it works for me:

[graham@fedora ~]$  sudo ln -s /var/lib/snapd/snap /snap
[sudo] password for graham: 
[graham@fedora ~]$ sudo snap install hello-world
2019-03-15T11:44:36Z INFO Waiting for restart...
hello-world 6.3 from Canonical✓ installed
[graham@fedora ~]$ hello-world
2019/03/15 11:45:00.040691 cmd_run.go:367: restoring default SELinux context of /home/graham/snap
Hello World!
[graham@fedora ~]$ hello-world
Hello World!

Could you send us the output from snap --version? Mine looks like this:

$  snap --version
snap    2.37.4-2.fc28
snapd   2.37.4-2.fc28
series  16
fedora  28
kernel  4.20.14-100.fc28.x86_64

#13

[root@0rcan0mic etc]# snap --version snap 2.37.4-2.fc28 snapd 2.37.4-2.fc28 series 16 fedora 28 kernel 4.16.3-301.fc28.x86_64

Here is the actual error:

[root@0rcan0mic etc]# sudo snap install hello-world
error: system does not fully support snapd: cannot mount squashfs image using "squashfs": mount:
       /tmp/sanity-mountpoint-257558992: unknown filesystem type 'squashfs'.

#14

Thanks! There’s a known issue with cloud installed Fedora (I’m guessing) - sorry for not communicating this, but it looks like there may be a kernel/driver/module version mismatch. It could be solved with a reboot, although we know this is problematic with cloud installs.


#15

the reboot didn’t fix the issue.
snap installed on local machine though.


#16

same issue in fed29 cloud version.

[root@localhost ~]# cat /etc/fedora-release
Fedora release 29 (Twenty Nine)
[root@localhost ~]# uname -a
Linux localhost.localdomain 5.0.6-200.fc29.x86_64 #1 SMP Wed Apr 3 15:09:51 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]# snap --version
snap 2.37.4-2.fc29
snapd 2.37.4-2.fc29
series 16
fedora 29
kernel 5.0.6-200.fc29.x86_64

[root@localhost ~]# snap install hello-world
error: system does not fully support snapd: cannot mount squashfs image using “squashfs”: mount:
/tmp/sanity-mountpoint-500924499: unknown filesystem type ‘squashfs’.