CentOS 7: error: system does not fully support snapd: cannot read the value of fs.may_detach_mounts kernel parameter

Unable to install redis-desktop-manager on centOS 7.

$ sudo snap install redis-desktop-manager
error: system does not fully support snapd: cannot read the value of
         fs.may_detach_mounts kernel parameter: open
         /proc/sys/fs/may_detach_mounts: no such file or directory

Details:

Operating System:

[root@localhost ~]$ cat /etc/os-release 
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

Snap Version:

[root@localhost ~]$ snap --version
snap    2.42.2-1.el7
snapd   2.42.2-1.el7
series  16
centos  7
kernel  3.10.0-327.el7.x86_64

Your kernel is too old. According to RPM changelog, your package release is:

* Thu Oct 29 2015 Rafael Aquini <aquini@redhat.com> [3.10.0-327.el7]

Please update to at least 3.10.0-620.el7. However, given the amount of fixes backported to the EL kernels, I suggest you go with the latest one.

2 Likes

Ok let me try upgrading my OS and try again. Thanks :slight_smile:

Thanks for the help! Upgrading kernel certainly fixed it.

[user@localhost ~]$ snap --version
snap    2.42.2-1.el7
snapd   2.42.2-1.el7
series  16
centos  7
kernel  5.4.1-1.el7.elrepo.x86_64

But then received this warning. (Restarting or Logout didn’t help)

user@localhost ~]$ sudo snap install redis-desktop-manager
2019-11-29T13:45:09-08:00 INFO Waiting for restart...
Warning: /var/lib/snapd/snap/bin was not found in your $PATH. If you've not restarted your session
         since you installed snapd, try doing that. Please see https://forum.snapcraft.io/t/9469
         for more details.

I had to add /var/lib/snapd/snap/bin in the $PATH variable

vi ~/bash_profile
export PATH=$PATH:/var/lib/snapd/snap/bin

That fixed the warning from showing up. In case any one else is running into similar issues.

AFAIK, this is because when running under sudo, your $PATH is reset:

[guest@localhost ~]$ echo $PATH
/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/var/lib/snapd/snap/bin:/home/guest/.local/bin:/home/guest/bin
[guest@localhost ~]$ sudo sh -c 'echo $PATH'
/sbin:/bin:/usr/sbin:/usr/bin

And it’s controlled by the default policy for sudo:

[guest@localhost ~]$ sudo grep -n -e 'Defaults.*env_reset' -e 'Defaults.*secure_path' /etc/sudoers
75:Defaults    env_reset
88:Defaults    secure_path = /sbin:/bin:/usr/sbin:/usr/bin
1 Like