Debian 13 trixie

Snap : インストール2025/09/30

 

パッケージ管理システム Snap をインストールします。

Snap システムで管理される Snap パッケージは、[APT] で管理されるシステムのパッケージに影響を及ぼすことなく、独立してインストール/起動することができます。

[1] Snap パッケージの利用には Snapd のインストールと起動が必要になります。
root@dlp:~#
apt -y install snapd
root@dlp:~#
systemctl enable snapd.service snapd.socket

root@dlp:~#
source /etc/profile.d/apps-bin-path.sh

[2] [Snap] コマンドの基本操作です。
# [hello-world] パッケージをインストール

root@dlp:~#
snap install hello-world

hello-world 6.4 from Canonical✓ installed
# インストール済 Snap パッケージ一覧

root@dlp:~#
snap list

Name         Version             Rev    Tracking       Publisher   Notes
core         16-2.61.4-20250626  17247  latest/stable  canonical✓  core
hello-world  6.4                 29     latest/stable  canonical✓  -
snapd        2.71                25202  latest/stable  canonical✓  snapd

# Snap リポジトリからパッケージをワード検索

root@dlp:~#
snap find kubernetes

Name                         Version               Publisher                 Notes    Summary
kubernetes-test              1.34.1                canonical✓                classic  tests for kubernetes
kubernetes-test-eks          1.10.3                canonical✓                classic  tests for kubernetes
microk8s                     v1.32.8               canonical✓                classic  Kubernetes for workstations and appliances
kata-containers              2.4.2                 katacontainers✓           classic  Build lightweight VMs that seamlessly plug into the containers ecosystem
.....
.....

# パッケージ情報を表示

root@dlp:~#
snap info hello-world

name:      hello-world
summary:   The 'hello-world' of snaps
publisher: Canonical✓
store-url: https://snapcraft.io/hello-world
contact:   snaps@canonical.com
license:   unset
description: |
  This is a simple hello world example.
commands:
  - hello-world.env
  - hello-world.evil
  - hello-world
  - hello-world.sh
snap-id:      buPKUD3TKqCOgLEjjHx5kSiCpIs5cMuQ
tracking:     latest/stable
refresh-date: today at 10:02 JST
channels:
  latest/stable:    6.4 2024-02-27 (29) 20kB -
  latest/candidate: 6.4 2024-02-27 (29) 20kB -
  latest/beta:      6.4 2024-02-27 (29) 20kB -
  latest/edge:      6.4 2024-02-27 (29) 20kB -
installed:          6.4            (29) 20kB -

# アプリケーション実行

root@dlp:~#
hello-world

Hello World!
# 実 PATH は以下

root@dlp:~#
which hello-world

/snap/bin/hello-world
# 実体はリンク

root@dlp:~#
ll /snap/bin/hello-world

lrwxrwxrwx 1 root root 13 Sep 30 10:02 /snap/bin/hello-world -> /usr/bin/snap
# アプリケーションを無効化する

root@dlp:~#
snap disable hello-world

hello-world disabled
root@dlp:~#
snap list

Name         Version             Rev    Tracking       Publisher   Notes
core         16-2.61.4-20250626  17247  latest/stable  canonical✓  core
hello-world  6.4                 29     latest/stable  canonical✓  disabled
snapd        2.71                25202  latest/stable  canonical✓  snapd

root@dlp:~#
hello-world

-bash: /snap/bin/hello-world: No such file or directory
# アプリケーションを有効化する

root@dlp:~#
snap enable hello-world

hello-world enabled
root@dlp:~#
hello-world

Hello World!
# アンインストールする場合は以下

root@dlp:~#
snap remove hello-world

hello-world removed
root@dlp:~#
snap list

Name   Version             Rev    Tracking       Publisher   Notes
core   16-2.61.4-20250626  17247  latest/stable  canonical✓  core
snapd  2.71                25202  latest/stable  canonical✓  snapd
関連コンテンツ