如何在 Alma Linux 8 上安装和使用 Snap Package Manager如何在 Alma Linux 8 上安装和使用 Snap Package Manager如何在 Alma Linux 8 上安装和使用 Snap Package Manager如何在 Alma Linux 8 上安装和使用 Snap Package Manager
  • 文章
  • 正则表达式
    • 工具
  • 登录
找到的结果: {phrase} (显示: {results_count} 共: {results_count_total})
显示: {results_count} 共: {results_count_total}

加载更多搜索结果...

搜索范围
模糊匹配
搜索标题
搜索内容
发表 admin at 2025年2月28日
类别
  • 未分类
标签

如何在 Alma Linux 8 上安装和使用 Snap Package Manager

在此页

  1. 先决条件
  2. 安装 Snapd
  3. 使用 Snap 查找包裹
  4. 使用 Snap 安装包
  5. 列出安装 Snap 包
  6. 使用 Snap 更新包
  7. 删除 Snap 包
  8. 结论

Snap 包管理器也称为 snapd 是 Linux 中的现代包管理器,它允许您在各种 Linux 发行版和版本中安装 Snap 包。 Snap 包是独立的,在沙盒环境中运行。您可以通过命令行安装 Snap 包,也可以将它们作为 .snap 文件从网站下载。 Snap 是一个通用的、交叉分布的、无依赖性的包管理器。 Snap 应用程序与所有依赖项打包在一起,可在所有主要 Linux 发行版上运行。

在本教程中,我将向您展示如何在 Alma Linux 8 上安装和使用 Snap Package Manager。

先决条件

  • 一台运行 Alma Linux 8 的服务器。
  • 在服务器上配置了根密码。

安装 Snapd

默认情况下,Snapd 包不包含在 Alma Linux 8 默认存储库中。所以你需要从 EPEL 仓库安装它。

首先,使用以下命令安装 EPEL 存储库:

dnf install epel-release -y

接下来,运行以下命令将 Snapd 包安装到您的系统中。

dnf install snapd -y

安装 Snapd 后,使用以下命令启动并启用 Snapd 服务:

systemctl enable --now snapd.socket
systemctl start --now snapd.socket

您可以使用以下命令检查 Snapd 服务的状态:

systemctl status snapd.socket

您将获得以下输出:

? snapd.socket - Socket activation for snappy daemon
   Loaded: loaded (/usr/lib/systemd/system/snapd.socket; enabled; vendor preset: disabled)
   Active: active (listening) since Mon 2022-02-28 10:30:21 UTC; 10s ago
   Listen: /run/snapd.socket (Stream)
           /run/snapd-snap.socket (Stream)
    Tasks: 0 (limit: 11412)
   Memory: 4.0K
   CGroup: /system.slice/snapd.socket

Feb 28 10:30:21 linux systemd[1]: Starting Socket activation for snappy daemon.
Feb 28 10:30:21 linux systemd[1]: Listening on Socket activation for snappy daemon.

要检查 Snapd 版本,请运行以下命令:

snap version

您将获得以下输出:

snap    2.54.3-1.el8
snapd   2.54.3-1.el8
series  16
rocky   8.5
kernel  4.18.0-348.12.2.el8_5.x86_64

使用 Snap 查找包裹

Snap 提供了一种从 Snap 存储库中查找所需包的更简单方法。

要列出 Snap 存储库中可用的所有 Snap 包,请运行以下命令:

snap find

您将在以下输出中获得所有 Snap 包的列表:

Name                       Version                Publisher              Notes    Summary
spotify                    1.1.77.643.g3c4c6fc6   spotify*               -        Music for everyone
gimp                       2.10.28                snapcrafters           -        GNU Image Manipulation Program
1password                  8.5.0                  1password*             -        1Password - Password Manager and Secure Wallet
code                       f80445ac               vscode*                classic  Code editing. Redefined.
vlc                        3.0.16                 videolan*              -        The ultimate media player
okular                     20.12.3                kde*                   -        Document Viewer
onlyoffice-desktopeditors  7.0.0                  onlyoffice*            -        A comprehensive office suite for editing documents, spreadsheets and presentations
liveforspeed               S3-6T                  mmtrt                  -        Live for Speed (LFS) is a online racing simulator.
bomber                     21.12.2                kde*                   -        Arcade Bombing Game
thunderbird                91.6.1                 canonical*             -        Mozilla Thunderbird email application
phpstorm                   2021.3.2               jetbrains*             classic  PhpStorm
signal-desktop             5.30.0                 snapcrafters           -        Signal Desktop
climate-trail              2.1                    merlijn-sebrechts      -        Surviving The Climate Apocalypse
gitkraken                  8.2.1                  gitkraken*             classic  For repo management, in-app code editing & issue tracking.
krita                      4.4.5                  krita*                 -        Digital Painting, Creative Freedom
vidcutter                  6.0.5.1                ozmartian              -        the simplest + fastest media cutter and joiner
scummvm                    2.5.1                  snapcrafters           -        ScummVM is a program which allows you to run numerous classic graphical point-and-click adventure games and role-playing games
bitwarden                  1.31.3                 bitwarden*             -        Bitwarden
pinta                      2.0.2                  james-carroll          -        Painting made simple!
typora                     1.1.5                  typora                 -        A minimal Markdown reading and writing app
picard                     2.7.3                  metabrainz-apps        -        Picard is the official MusicBrainz audio tagger
jami                       20211222.1.3e5b149     sfljami                -        Jami, a secure, distributed communication software and SIP client
brave                      1.35.103               brave                  -        Browse faster and safer with Brave.
konversation               21.12.1                kde*                   -        IRC client
omniawrite                 1.3.2                  torsten.dittmann       -        OmniaWrite - A text editor engineered for creative writing.
opera                      84.0.4316.21           opera-software*        -        Fast, secure, easy-to-use browser
plexmediaserver            1.25.6.5577-c8bd13540  plexinc*               -        Your media on all your devices.
powershell                 7.2.1                  microsoft-powershell*  classic  PowerShell for every system!

要查找特定包,请运行以下命令:

snap find vlc

这将找到 VLC 包和其他类似的包,如下所示:

Name             Version                 Publisher  Notes  Summary
vlc              3.0.16                  videolan*  -      The ultimate media player
mjpg-streamer    2.0                     ogra       -      UVC webcam streaming tool
audio-recorder   3.0.5+rev1432+pkg-7b07  brlin      -      A free audio-recorder for Linux (EXTREMELY BUGGY)
dav1d            0.9.2                   videolan*  -      AV1 decoder from VideoLAN
gridplayer       0.2.1                   vzhd1701   -      Play videos side-by-side
orion-desktop    0.0.10                  keshavnrj  -      Complete torrent client and streamer for Linux Desktop
kycli            0+git.9591d6e           dvlc       -      The command line interface to the unofficialKYC platform.
peerflix         v0.39.0+git1.df28e20    pmagill    -      Streaming torrent client for Node.js
test-streamlink  1.4.1-64-g599f362e      addq1eax   -      test-Streamlink

使用 Snap 安装包

要安装特定包,请运行以下命令:

snap install vlc

这会将 VLC 包安装到您的系统中。

要验证有关 VLC 包的信息,请运行以下命令:

snap info vlc

您应该看到以下信息:

name:      vlc
summary:   The ultimate media player
publisher: VideoLAN*
store-url: https://snapcraft.io/vlc
contact:   https://www.videolan.org/support/
license:   unset
description: |
  VLC is the VideoLAN project's media player.
  
  Completely open source and privacy-friendly, it plays every multimedia file and streams.
  
  It notably plays MKV, MP4, MPEG, MPEG-2, MPEG-4, DivX, MOV, WMV, QuickTime, WebM, FLAC, MP3,
  Ogg/Vorbis files, BluRays, DVDs, VCDs, podcasts, and multimedia streams from various network
  sources. It supports subtitles, closed captions and is translated in numerous languages.
commands:
  - vlc
snap-id:      RT9mcUhVsRYrDLG8qnvGiy26NKvv6Qkd
tracking:     latest/stable
refresh-date: today at 10:32 UTC
channels:
  latest/stable:    3.0.16                      2021-06-28 (2344) 310MB -
  latest/candidate: 3.0.16                      2021-06-28 (2344) 310MB -
  latest/beta:      3.0.17-1-2-g0cc084b032      2022-02-28 (2848) 335MB -
  latest/edge:      4.0.0-dev-18410-g56db9925fc 2022-02-28 (2849) 614MB -
installed:          3.0.16                                 (2344) 310MB -

默认情况下,Snap 将所有包存储在 /var/lib/snapd/snaps/ 目录中。您可以使用以下命令列出它们:

ls /var/lib/snapd/snaps/

您应该看到以下输出:

core18_2284.snap  snapd_14978.snap  vlc_2344.snap

列出安装 Snap 包

要列出系统上安装的所有 Snap 包,请运行以下命令:

snap list

您将在以下输出中获得所有已安装软件包的列表:

Name    Version   Rev    Tracking       Publisher   Notes
core18  20211215  2284   latest/stable  canonical*  base
snapd   2.54.3    14978  latest/stable  canonical*  snapd
vlc     3.0.16    2344   latest/stable  videolan*   -

使用 Snap 更新包

要更新包,请运行以下命令:

snap refresh vlc

这会将 VLC 包更新到最新版本。

如果要查看 Snap 最近所做的更改,请运行以下命令:

snap changes

您应该看到以下输出:

ID   Status  Spawn               Ready               Summary
1    Done    today at 10:30 UTC  today at 10:30 UTC  Initialize system state
2    Done    today at 10:31 UTC  today at 10:32 UTC  Install "vlc" snap
3    Done    today at 10:31 UTC  today at 10:31 UTC  Initialize device

删除 Snap 包

如果要从系统中删除特定包,请运行以下命令:

snap remove vlc

这将从系统中删除 VLC 包。

结论

在这篇文章中,我们解释了如何在 Alma Linux 8 上安装和使用 Snap 包管理器。您现在可以轻松地在您的系统上安装和管理 Snap 包。如果您有任何问题,请随时问我。

©2015-2025 艾丽卡 support@alaica.com