How to install snap on CentOS


Snap is available for CentOS 8 and CentOS 7, from the 7.5 release onwards. It’s also available for Red Hat Enterprise Linux (RHEL) 7.5+

Step 1: Adding EPEL

CentOS 8

sudo dnf install epel-release
sudo dnf upgrade

CentOS 7

sudo yum install epel-release

Step 2: Installing snapd

sudo yum install snapd

Example for CentOS 7.9

tutorialspots# sudo yum install snapd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.mirror.constant.com
 * epel: ftp-nyc.osuosl.org
 * extras: centos.mirror.constant.com
 * remi-safe: mirror.oxilion.nl
 * updates: centos.mirror.constant.com
http://yum.mariadb.org/10.0/centos7-amd64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below wiki article

https://wiki.centos.org/yum-errors

If above article doesn't help to resolve this issue please use https://bugs.centos.org/.

Resolving Dependencies
--> Running transaction check
---> Package snapd.x86_64 0:2.55.3-1.el7 will be installed
--> Processing Dependency: snap-confine(x86-64) = 2.55.3-1.el7 for package: snapd-2.55.3-1.el7.x86_64
--> Processing Dependency: bash-completion for package: snapd-2.55.3-1.el7.x86_64
--> Processing Dependency: fuse for package: snapd-2.55.3-1.el7.x86_64
--> Processing Dependency: squashfs-tools for package: snapd-2.55.3-1.el7.x86_64
--> Processing Dependency: squashfuse for package: snapd-2.55.3-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.55.3-1.el7 will be installed
---> 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
--> Running transaction check
---> Package fuse-libs.x86_64 0:2.9.2-11.el7 will be installed
---> Package squashfuse-libs.x86_64 0:0.1.102-1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package              Arch        Version                       Repository
                                                                           Size
================================================================================
Installing:
 snapd                x86_64      2.55.3-1.el7                  epel       16 M
Installing for dependencies:
 bash-completion      noarch      1:2.1-8.el7                   base       87 k
 fuse                 x86_64      2.9.2-11.el7                  base       86 k
 fuse-libs            x86_64      2.9.2-11.el7                  base       93 k
 snap-confine         x86_64      2.55.3-1.el7                  epel      3.5 M
 squashfs-tools       x86_64      4.3-0.21.gitaae0aff4.el7      base      101 k
 squashfuse           x86_64      0.1.102-1.el7                 epel       18 k
 squashfuse-libs      x86_64      0.1.102-1.el7                 epel       24 k

Transaction Summary
================================================================================
Install  1 Package (+7 Dependent packages)

Total download size: 20 M
Installed size: 58 M
Is this ok [y/d/N]: y
Downloading packages:
(1/8): fuse-2.9.2-11.el7.x86_64.rpm                        |  86 kB   00:00
(2/8): bash-completion-2.1-8.el7.noarch.rpm                |  87 kB   00:00
(3/8): fuse-libs-2.9.2-11.el7.x86_64.rpm                   |  93 kB   00:00
(4/8): snap-confine-2.55.3-1.el7.x86_64.rpm                | 3.5 MB   00:01
(5/8): squashfs-tools-4.3-0.21.gitaae0aff4.el7.x86_64.rpm  | 101 kB   00:00
(6/8): snapd-2.55.3-1.el7.x86_64.rpm                       |  16 MB   00:00
(7/8): squashfuse-0.1.102-1.el7.x86_64.rpm                 |  18 kB   00:00
(8/8): squashfuse-libs-0.1.102-1.el7.x86_64.rpm            |  24 kB   00:00
--------------------------------------------------------------------------------
Total                                              5.3 MB/s |  20 MB  00:03
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 1:bash-completion-2.1-8.el7.noarch                           1/8
  Installing : squashfs-tools-4.3-0.21.gitaae0aff4.el7.x86_64               2/8
  Installing : snap-confine-2.55.3-1.el7.x86_64                             3/8
  Installing : fuse-2.9.2-11.el7.x86_64                                     4/8
  Installing : fuse-libs-2.9.2-11.el7.x86_64                                5/8
  Installing : squashfuse-libs-0.1.102-1.el7.x86_64                         6/8
  Installing : squashfuse-0.1.102-1.el7.x86_64                              7/8
  Installing : snapd-2.55.3-1.el7.x86_64                                    8/8
  Verifying  : snapd-2.55.3-1.el7.x86_64                                    1/8
  Verifying  : squashfuse-libs-0.1.102-1.el7.x86_64                         2/8
  Verifying  : fuse-libs-2.9.2-11.el7.x86_64                                3/8
  Verifying  : fuse-2.9.2-11.el7.x86_64                                     4/8
  Verifying  : snap-confine-2.55.3-1.el7.x86_64                             5/8
  Verifying  : squashfs-tools-4.3-0.21.gitaae0aff4.el7.x86_64               6/8
  Verifying  : 1:bash-completion-2.1-8.el7.noarch                           7/8
  Verifying  : squashfuse-0.1.102-1.el7.x86_64                              8/8

Installed:
  snapd.x86_64 0:2.55.3-1.el7

Dependency Installed:
  bash-completion.noarch 1:2.1-8.el7
  fuse.x86_64 0:2.9.2-11.el7
  fuse-libs.x86_64 0:2.9.2-11.el7
  snap-confine.x86_64 0:2.55.3-1.el7
  squashfs-tools.x86_64 0:4.3-0.21.gitaae0aff4.el7
  squashfuse.x86_64 0:0.1.102-1.el7
  squashfuse-libs.x86_64 0:0.1.102-1.el7

Complete!

Step 3: sudo systemctl enable --now snapd.socket

[root@tutorialspots ~]# sudo systemctl enable --now snapd.socket
Created symlink from /etc/systemd/system/sockets.target.wants/snapd.socket to /usr/lib/systemd/system/snapd.socket.

Step 4: enable classic snap support

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

Step 5:

systemctl enable snapd.seeded.service
systemctl start snapd.seeded.service

Leave a Reply