I recently installed the Nvidia drivers on my CentOS 8 Installation. This caused CentOS 8 to force X11 instead of Wayland. And with this came problems with snap.
I previously installed snapd when I used Wayland and nouveau and everything worked fine. But after the Nvidia drivers was installed, I could not find my snaps anymore. So I purged the system of anything related to snap and snapd and tried to re-install.
Installing snapd
First, some details about my system:
System information (click to view)
$ snap version
snap 2.43.3-1.el8
snapd 2.43.3-1.el8
series 16
centos 8
kernel 4.18.0-147.5.1.el8_1.x86_64
$ uname -a
Linux 4.18.0-147.5.1.el8_1.x86_64 #1 SMP Wed Feb 5 02:00:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/os-release
NAME="CentOS Linux"
VERSION="8 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8 (Core)"
CPE_NAME="cpe:/o:centos:centos:8"
$ bash --version | grep version
GNU bash, version 4.4.19(1)-release (x86_64-redhat-linux-gnu)
Gnome Version 3.32.2
I have tried to install snap both using sudo, and without (having to enter the password in elevated mode). Bot produce errors, albeit different ones:
Installation process (click to view)
I install as follows:
# dnf install snap
I follow the written instructions here:
# systemctl enable --now snapd.socket
# ln -s /var/lib/snapd/snap /snap
Then I check my paths:
$ printenv PATH
/home/MYUSER/.local/bin:/home/MYUSER/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/var/lib/snapd/snap/bin
# printenv PATH
/sbin:/bin:/usr/sbin:/usr/bin:/var/lib/snapd/snap/bin
Note: I had to add snap to visudo (secure_path) manually. Which I read about somewhere here on the forum.
As you can see, everything checks out so far. The problems start when I try to install snaps (snap-store as example):
Installing snap-store
How I install snap-store (click to view)
I can now install snap-store, if I do
$ snap install snap-store
It fetch core18, gnome-3-28-1804 and gtk-common-themes, before it grabs snap-store. It returns:
snap-store 20191114.a9948d5 from Canonical✓ installed
Out of the gate, I cannot find it in Applications or by searching for it in Gnome. And when I try to run it from the terminal, I get this:
11:32:14:0511 Gtk Failed to load module "pk-gtk-module"
11:32:14:0514 Gtk Failed to load module "pk-gtk-module"
11:32:14:0569 Gs enabled plugins: odrs, rewrite-resource, snap, icons, key-colors, key-colors-metadata
11:32:14:0569 Gs disabled plugins: appstream, desktop-categories, desktop-menu-path, dpkg, dummy, epiphany, fedora-pkgdb-collections, generic-updates, hardcoded-blacklist, hardcoded-featured, hardcoded-popular, modalias, os-release, provenance, provenance-license, repos, shell-extensions
11:32:52:0323 Gs failed to create an app for */*/*/*/system/*
11:32:52:0324 Gs updates-shell: failed to get updates: no plugin could handle get-updates
11:32:52:0324 Gs failed to create an app for */*/*/*/system/*
11:32:52:0324 Gs failed to get system app
11:32:52:0328 GsPluginSnap Failed to load snap icon: local snap has no icon
However, the snap-store loads, and I can search for things. But this does not add snap-store to the app launcher as expected either - and it is not obvious to me that snap-store was properly installed.
Removing snap-store
Removal process (click to view)
removing snap-store with the command
$ snap remove snap-store
will produce
snap-store removed
But also a load of SELinux, such as:
The source process /usr/libexec/snap/snapd
Attempted this access: rmdir
On this directory: dconf
Here are all the alerts I get:
Installing Spotify
Installation process (click to view)
If I try to install Spotify, I do not get any errors in the terminal, but it is not added to app launcher. If I start with snap run spotify
I get the following messages:
Gtk-Message: 13:19:20.757: Failed to load module "pk-gtk-module"
Gtk-Message: 13:19:20.758: Failed to load module "canberra-gtk-module"
If I also drop the spotify folder i backed up from my home directory under ~/snap/
It will reuse the old session and I am logged in to my spotify account, so there seems that snapd is correctly linking the snaps to the configs located there.
Notes on sudo
If I do the sudo route as instructed in the documentation, I get a totally different set of issues:
# snap install snap-store
# snap run snap-store
I get this:
11:49:25:0897 GLib-GIO g_app_info_get_name: assertion 'G_IS_APP_INFO (appinfo)' failed
11:49:25:0925 Gtk Failed to load module "pk-gtk-module"
11:49:25:0928 Gtk Failed to load module "pk-gtk-module"
11:49:25:0928 GLib-GIO g_dbus_proxy_new_sync: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
11:49:25:0938 Gs enabled plugins: odrs, rewrite-resource, snap, icons, key-colors, key-colors-metadata
11:49:25:0938 Gs disabled plugins: appstream, desktop-categories, desktop-menu-path, dpkg, dummy, epiphany, fedora-pkgdb-collections, generic-updates, hardcoded-blacklist, hardcoded-featured, hardcoded-popular, modalias, os-release, provenance, provenance-license, repos, shell-extensions
Segmentation fault
and I also get the same SELinux problems when I remove snap-store using sudo.
Is there anyone who can shed a light on what I am doing wrong here? I have no clue why snapd fails to add the icons and links in applauncher, and I dont understand why I am seeing these errors during run.