5

I'm not a Linux Admin but need help in getting snapd installed.

Below is my system details.

[root@vultr nginx]# hostnamectl
   Static hostname: vultr.guest
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 906711fa42644844bc1f9fde4d4y2a68
           Boot ID: 2b3e8d969ff540ae850f504cefy215ef
    Virtualization: kvm
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-957.5.1.el7.x86_64
      Architecture: x86-64

Here is the failing install command.

[root@vultr nginx]# yum install snapd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.newmediaexpress.com
 * epel: fedora.ipserverone.com
 * extras: mirror.newmediaexpress.com
 * remi-php72: mirror.telkomuniversity.ac.id
 * remi-safe: mirror.telkomuniversity.ac.id
 * updates: mirror.newmediaexpress.com
Resolving Dependencies
--> Running transaction check
---> Package snapd.x86_64 0:2.47.1-1.el7 will be installed
--> Processing Dependency: snap-confine(x86-64) = 2.47.1-1.el7 for package: snapd-2.47.1-1.el7.x86_64
--> Processing Dependency: snapd-selinux = 2.47.1-1.el7 for package: snapd-2.47.1-1.el7.x86_64
--> Processing Dependency: bash-completion for package: snapd-2.47.1-1.el7.x86_64
--> Processing Dependency: fuse for package: snapd-2.47.1-1.el7.x86_64
--> Processing Dependency: squashfs-tools for package: snapd-2.47.1-1.el7.x86_64
--> Processing Dependency: squashfuse for package: snapd-2.47.1-1.el7.x86_64
--> Running transaction check
---> Package bash-completion.noarch 1:2.1-8.el7 will be installed
---> Package fuse.x86_64 0:2.9.2-11.el7 will be installed
---> Package snap-confine.x86_64 0:2.47.1-1.el7 will be installed
---> Package snapd-selinux.noarch 0:2.47.1-1.el7 will be installed
--> Processing Dependency: selinux-policy-base >= 3.13.1-268.el7 for package: snapd-selinux-2.47.1-1.el7.noarch
---> Package squashfs-tools.x86_64 0:4.3-0.21.gitaae0aff4.el7 will be installed
---> Package squashfuse.x86_64 0:0.1.102-1.el7 will be installed
--> Processing Dependency: squashfuse-libs(x86-64) = 0.1.102-1.el7 for package: squashfuse-0.1.102-1.el7.x86_64
--> Processing Dependency: libfuse.so.2(FUSE_2.4)(64bit) for package: squashfuse-0.1.102-1.el7.x86_64
--> Processing Dependency: libfuse.so.2(FUSE_2.5)(64bit) for package: squashfuse-0.1.102-1.el7.x86_64
--> Processing Dependency: libfuse.so.2(FUSE_2.6)(64bit) for package: squashfuse-0.1.102-1.el7.x86_64
--> Processing Dependency: libfuse.so.2(FUSE_2.8)(64bit) for package: squashfuse-0.1.102-1.el7.x86_64
--> Processing Dependency: libfuse.so.2()(64bit) for package: squashfuse-0.1.102-1.el7.x86_64
--> Processing Dependency: libfuseprivate.so.0()(64bit) for package: squashfuse-0.1.102-1.el7.x86_64
--> Processing Dependency: libsquashfuse.so.0()(64bit) for package: squashfuse-0.1.102-1.el7.x86_64
--> Processing Dependency: libzstd.so.1()(64bit) for package: squashfuse-0.1.102-1.el7.x86_64
--> Running transaction check
---> Package fuse-libs.x86_64 0:2.9.2-11.el7 will be installed
---> Package libzstd.x86_64 0:1.4.5-3.el7 will be installed
---> Package snapd-selinux.noarch 0:2.47.1-1.el7 will be installed
--> Processing Dependency: selinux-policy-base >= 3.13.1-268.el7 for package: snapd-selinux-2.47.1-1.el7.noarch
---> Package squashfuse-libs.x86_64 0:0.1.102-1.el7 will be installed
--> Finished Dependency Resolution
Error: Package: snapd-selinux-2.47.1-1.el7.noarch (epel)
           Requires: selinux-policy-base >= 3.13.1-268.el7
           Available: selinux-policy-minimum-3.13.1-266.el7.noarch (base)
               selinux-policy-base = 3.13.1-266.el7
           Available: selinux-policy-minimum-3.13.1-266.el7_8.1.noarch (updates)
               selinux-policy-base = 3.13.1-266.el7_8.1
           Available: selinux-policy-mls-3.13.1-266.el7.noarch (base)
               selinux-policy-base = 3.13.1-266.el7
           Available: selinux-policy-mls-3.13.1-266.el7_8.1.noarch (updates)
               selinux-policy-base = 3.13.1-266.el7_8.1
           Available: selinux-policy-targeted-3.13.1-266.el7.noarch (base)
               selinux-policy-base = 3.13.1-266.el7
           Available: selinux-policy-targeted-3.13.1-266.el7_8.1.noarch (updates)
               selinux-policy-base = 3.13.1-266.el7_8.1
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
2
  • The last stable snapd package for el7.x86_64 on epel was snapd-2.45.3.1-1.el7.x86_64. This is the version I currently have running on my CentOS 7 VPS. I tried but couldn't find this package available anywhere currently. Maybe you'll have better luck.
    – cyqsimon
    Nov 9, 2020 at 13:13
  • @Ashar, you need to update selinux-policy packages, see if my example bellow fixes it.
    – Noam Manos
    Nov 16, 2020 at 10:00

4 Answers 4

3

Try to reinstall selinux-policy and selinux-policy-targeted directly from a local/remote path, for example:

$ sudo yum remove selinux-policy-base

Removed:
  selinux-policy-minimum.noarch 0:3.13.1-268.el7
  selinux-policy-targeted.noarch 0:3.13.1-268.el7 


$ sudo yum install \
http://mirror.centos.org/centos/7/updates/x86_64/Packages/selinux-policy-3.13.1-268.el7_9.2.noarch.rpm \
http://mirror.centos.org/centos/7/updates/x86_64/Packages/selinux-policy-targeted-3.13.1-268.el7_9.2.noarch.rpm

Then, installing snapd should work:

$ sudo yum install snapd

Updated:
  snapd.x86_64 0:2.47.1-1.el7                                                                                                                                                                            

Dependency Updated:
  snap-confine.x86_64 0:2.47.1-1.el7                                                                 snapd-selinux.noarch 0:2.47.1-1.el7                                                                

Complete!
1

For some reason it requires CentOS 7.9 which is not released yet. You can either change to the continuous release of CentOS, by doing a sudo yum --enablerepo=cr update or wait for CentOS 7.9

2
  • tried your suggestion but the error persists!!
    – Ashar
    Nov 4, 2020 at 13:25
  • It was probably built against RHEL 7.9, and the selinux packages haven’t been built for CR yet.
    – jsbillings
    Nov 8, 2020 at 22:25
1

From snap website https://snapcraft.io/docs/installing-snap-on-centos

You need to enable CR (Continuous Release) repository. Try running sudo yum-config-manager --enable cr and then run sudo yum install snapd. This should fix the error.

0

2020-11-14 Update

CentOS 7.9 release is now available on the base repository, alongside the required version of selinux-policy-base.

Just run yum update to install centos-release-7-9.2009.0.el7.centos, then you can install snap with yum install snapd.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.