Snap mounting Snapd and applications on CentOS 7 / CentOS 8

What are the snap?

  • SquashFS is a file system that contains the application code and snapshots. snap.yaml file contains specific metadata. It has a read-only file system, after installation there is a writable area.
  • It is independent. It comes bundled with most of the required libraries and run, and can be updated without affecting the rest of the case and restore the system.
  • It is limited to the OS and other applications through the security mechanism, but can granular policy control and OS user defaults exchange content and functionality of other snap.

What is Snapd?

Snapd REST API daemon is a service that runs on your Linux system for managing snap pack ( "snaps"). It interacts with the snap store, and provide customers interact with command end snap. Before you start management snap on any Linux distribution, you must install snapd.

Why use a snap?

Snap any application for each packaged Linux desktop, server, cloud or equipment. Snaps installation faster and are easier to create, run safer, and they will be automatically updated, so your application is always up to date and never interrupted. You can bring your own infrastructure or use the official.

Snapd installation and use on CentOS 8 / CentOS 7

Install Snapd CentOS 7 on the server as follows.

Snap mounted on CentOS 8

Add EPEL repository

Snap mounted on CentOS 8

Snap mounted on CentOS 7

Start the installation by adding epel repository and install copr yum plugin.

Then add the repository:

After adding the repository, install snapcore package.

Wait for the installation to complete, and then enable snapd socket:

Snapd now ready for use. You can use the snap command to interact with it. Please see the following help pages:

在CentOS 7/CentOS 8上安装Snapd和snap应用程序

Snap install applications on CentOS 7 / CentOS 8

We use the command-line tools and snap snap snap the store provided by the interaction.

Search snap:

To search snap, please use

$ snap find <search terms>

This will store the query results and lists its version number, the developer name, and description.

我将以一个示例在CentOS 8服务器上安装Microsoft PowerShell自动化和配置管理平台为例。

在CentOS 7/CentOS 8上安装Snapd和snap应用程序

通过运行以下命令安装snap:

sudo snap install powershell --classic

等待下载完成,下载速度可达1-2MB/s。 由于二进制文件位于 /snap/bin/下,我们需要将其添加到$PATH变量中。

sudo snap install powershell --classic

使用source命令以获得新路径

通过启动pwsh会话进行测试。

https://aka.ms/pscore6-docs
Type 'help' to get help.

sudo snap install powershell --classic

列出已安装的snap:

sudo snap install powershell --classic

通过运行快照刷新来手动更新snap

在CentOS 7/CentOS 8上安装Snapd和snap应用程序

移除snap

要删除snap,只需运行如下命令即可。snap remove <snap名称>在我们的例子中,只需执行以下操作:

检查snap信息:

使用命令snap信息来检查有关snap包的更多信息。

在CentOS 7/CentOS 8上安装Snapd和snap应用程序

回滚到应用程序的先前版本

使用snap还原

总结

现在,您应该能够安装snap了,手动更新它们,删除它们,检查已安装的snap等等。snap命令行被设计得尽可能简单和易于记忆。

Guess you like

Origin www.linuxidc.com/Linux/2020-03/162485.htm