怎样安装Snap

2020年3月19日 | 分类: 【技术】

【介绍】

如果你在使用Ubuntu 18.04/20.04 LTS版本的Ubuntu系统,会发现系统里面多了一个应用格式包——.snap包。Snap包是Ubuntu 16.04 LTS发布时引入的新应用格式包。目前已流行在Ubuntu且在其他如Debian、Arch Linux、Fedora、Kaili Linux、openSUSE、Red Hat等Linux发行版上通过snapd来安装使用snap应用。较传统Linux的rpm,deb软件包,snap有什么特点和优势呢?下面将为你介绍snap软件包。

参考:https://www.jianshu.com/p/70622b2e9c5d
参考:https://cn.ubuntu.com/blog/what-is-snap-application

【使用】

参考:https://www.linuxidc.com/Linux/2018-05/152385.htm

【安装:Ubuntu】

sudo apt-get install snap -y

【安装:CentOS】

参考:https://bobcares.com/blog/install-certbot-dns-cloudflare/

sudo yum install epel-release
sudo yum install snapd

报错:

Error:
 Problem: package snapd-2.56.2-1.el8.x86_64 requires snapd-selinux = 2.56.2-1.el8, but none of the providers can be installed
  - conflicting requests
  - nothing provides selinux-policy >= 3.14.3-95.el8 needed by snapd-selinux-2.56.2-1.el8.noarch
  - nothing provides selinux-policy-base >= 3.14.3-95.el8 needed by snapd-selinux-2.56.2-1.el8.noarch

参考:https://blog.csdn.net/wangyun381974024/article/details/128319707
参考:https://unix.stackexchange.com/questions/685652/nothing-provides-selinux-policy-base-3-14-3-80-el8-5-2
参考:https://pkgs.org/search/?q=selinux-policy

yum install http://mirror.centos.org/centos/8-stream/BaseOS/aarch64/os/Packages/selinux-policy-targeted-3.14.3-108.el8.noarch.rpm http://mirror.centos.org/centos/8-stream/BaseOS/aarch64/os/Packages/selinux-policy-3.14.3-108.el8.noarch.rpm http://mirror.centos.org/centos/8-stream/BaseOS/aarch64/os/Packages/selinux-policy-minimum-3.14.3-108.el8.noarch.rpm

然后成功安装 snapd 。

设置 snapd 为开机启动:

sudo systemctl enable --now snapd.socket

创建软连接:

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

!!!重启服务器!!!

【排错】

报错:error: too early for operation, device not yet seeded or device model not acknowledged

重启服务器即可。

报错:No package snapd available

参考:https://computingforgeeks.com/install-snapd-snap-applications-centos-7/
参考:https://www.linuxidc.com/Linux/2020-03/162485.htm
参考:https://blog.csdn.net/u013078422/article/details/82887940

报错:Requires: squashfuse

参考:https://centos.pkgs.org/7/epel-x86_64/squashfuse-libs-0.1.102-1.el7.x86_64.rpm.html
参考:https://github.com/pmq20/squashfuse

尚未解决。