Ubuntu 24.04 パッケージ管理システムSnappy をインストールする

環境
Ubuntu 24.04

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

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
Snappy システムで管理される Snap パッケージは、[APT] で管理されるシステムのパッケージに影響を及ぼすことなく、独立してインストール/起動することができます。
Snappy システムで管理される Snap パッケージは、[APT] で管理されるシステムのパッケージに影響を及ぼすことなく、独立してインストール/起動することができます。
Snappy システムで管理される Snap パッケージは、[APT] で管理されるシステムのパッケージに影響を及ぼすことなく、独立してインストール/起動することができます。

1.Snap パッケージの利用には Snapd のインストールと起動が必要になります。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# apt -y install snapd
# systemctl enable snapd.service snapd.socket
# source /etc/profile.d/apps-bin-path.sh
# apt -y install snapd # systemctl enable snapd.service snapd.socket # source /etc/profile.d/apps-bin-path.sh
# apt -y install snapd

# systemctl enable snapd.service snapd.socket
# source /etc/profile.d/apps-bin-path.sh

2.Snap リポジトリからパッケージをワード検索する

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# snap find kubernetes
Name Version Publisher Notes Summary
kubernetes-worker 0.0.2 canonical✓ - A complete Kubernetes worker
kubernetes-test 1.29.4 canonical✓ classic tests for kubernetes
kubernetes-test-eks 1.10.3 canonical-cloud-snaps classic tests for kubernetes
microk8s v1.29.4 canonical✓ classic Kubernetes for workstations and appliances
# snap find kubernetes Name Version Publisher Notes Summary kubernetes-worker 0.0.2 canonical✓ - A complete Kubernetes worker kubernetes-test 1.29.4 canonical✓ classic tests for kubernetes kubernetes-test-eks 1.10.3 canonical-cloud-snaps classic tests for kubernetes microk8s v1.29.4 canonical✓ classic Kubernetes for workstations and appliances 略
# snap find kubernetes
Name                         Version               Publisher              Notes    Summary
kubernetes-worker            0.0.2                 canonical✓             -        A complete Kubernetes worker
kubernetes-test              1.29.4                canonical✓             classic  tests for kubernetes
kubernetes-test-eks          1.10.3                canonical-cloud-snaps  classic  tests for kubernetes
microk8s                     v1.29.4               canonical✓             classic  Kubernetes for workstations and appliances
略

# [hello-world] パッケージをインストール

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# snap install hello-world
hello-world 6.4 from Canonical✓ installed
# snap list
Name Version Rev Tracking Publisher Notes
core 16-2.61.2 16928 latest/stable canonical✓ core
hello-world 6.4 29 latest/stable canonical✓ -
# snap install hello-world hello-world 6.4 from Canonical✓ installed # snap list Name Version Rev Tracking Publisher Notes core 16-2.61.2 16928 latest/stable canonical✓ core hello-world 6.4 29 latest/stable canonical✓ -
# snap install hello-world
hello-world 6.4 from Canonical✓ installed
# snap list
Name         Version    Rev    Tracking       Publisher   Notes
core         16-2.61.2  16928  latest/stable  canonical✓  core
hello-world  6.4        29     latest/stable  canonical✓  -

# パッケージ情報を表示
# snap info hello-world

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
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 02:36 UTC
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 -
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 02:36 UTC 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 -
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 02:36 UTC
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 -

# アプリケーションを実行する

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# hello-world
Hello World!
# hello-world Hello World!
# hello-world
Hello World!

# 実 PATH を確認する

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# which hello-world
/snap/bin/hello-world
# which hello-world /snap/bin/hello-world
# which hello-world
/snap/bin/hello-world

# リンクを確認する

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# ll /snap/bin/hello-world
lrwxrwxrwx 1 root root 13 May 13 02:36 /snap/bin/hello-world -> /usr/bin/snap*
# ll /snap/bin/hello-world lrwxrwxrwx 1 root root 13 May 13 02:36 /snap/bin/hello-world -> /usr/bin/snap*
# ll /snap/bin/hello-world
lrwxrwxrwx 1 root root 13 May 13 02:36 /snap/bin/hello-world -> /usr/bin/snap*

# アプリケーションを無効化する
# snap disable hello-world
hello-world disabled
# snap list

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
Name Version Rev Tracking Publisher Notes
core 16-2.61.2 16928 latest/stable canonical✓ core
hello-world 6.4 29 latest/stable canonical✓ disabled
Name Version Rev Tracking Publisher Notes core 16-2.61.2 16928 latest/stable canonical✓ core hello-world 6.4 29 latest/stable canonical✓ disabled
Name Version Rev Tracking Publisher Notes
core 16-2.61.2 16928 latest/stable canonical✓ core
hello-world 6.4 29 latest/stable canonical✓ disabled

# アプリケーションを有効化する

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# snap enable hello-world
hello-world enabled
# hello-world
Hello World!
# snap enable hello-world hello-world enabled # hello-world Hello World!
# snap enable hello-world
hello-world enabled
# hello-world
Hello World!

# アンインストールする場合は以下コマンドを実行する

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# snap remove hello-world
hello-world removed
# snap remove hello-world hello-world removed
# snap remove hello-world
hello-world removed

# snap list

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
Name Version Rev Tracking Publisher Notes
core 16-2.61.2 16928 latest/stable canonical✓ core
Name Version Rev Tracking Publisher Notes core 16-2.61.2 16928 latest/stable canonical✓ core
Name Version Rev Tracking Publisher Notes
core 16-2.61.2 16928 latest/stable canonical✓ core

 

 

IT

Posted by arkgame