ASP站长网本文介绍如何在CentOS 7操作系统中安装Snapd的方法,文末附上运行snap --help命令返回的内容。
具体方法
1、首先安装COPR插件和EPEL,通过添加epel存储库并安装copr yum插件来启动安装,运行如下命令:
sudo yum install epel-release
sudo yum install yum-plugin-copr
如何在CentOS 7中安装Snapd
2、然后添加repo:
$ sudo yum copr enable ngompa/snapcore-el7
如何在CentOS 7中安装Snapd
Loaded plugins: copr, fastestmirror
You are about to enable a Copr repository. Please note that this repository is not part of the main Fedora distribution, and quality may vary.
The Fedora Project does not exercise any power over the contents of this repository beyond the rules outlined in the Copr FAQ at
<https://fedorahosted.org/copr/wiki/UserDocs#WhatIcanbuildinCopr>, and packages are not held to any quality or securty level.
Please do not file bug reports about these packages in Fedora Bugzilla. In case of problems, contact the owner of this repository.
Do you want to continue? [y/N]: y
copr done
3、添加存储库后,安装snapd软件包,运行以下命令:
sudo yum -y install snapd
如何在CentOS 7中安装Snapd
4、等待安装完成后启用snapd socket:
$ sudo systemctl enable --now snapd.socket
Created symlink from /etc/systemd/system/sockets.target.wants/snapd.socket to /usr/lib/systemd/system/snapd.socket.
5、限制需要从/snap到/var/lib/snapd/snap下的/snap或符号链接下的snaps,为它创建一个符号链接,如下命令:
sudo ln -s /var/lib/snapd/snap /snap
如何在CentOS 7中安装Snapd
做到这里,Snapd已经安装完成了。
附:snap用法及参数(英文)
# snap --help
如何在CentOS 7中安装Snapd
用法:snap [OPTIONS] <command>
Install, configure, refresh and remove snap packages. Snaps are 'universal' packages that work across many different Linux systems,enabling secure distribution of the latest apps and utilities for cloud, servers, desktops and the internet of things.
This is the CLI for snapd, a background service that takes care of snaps on the system. Start with 'snap list' to see installed snaps.