Snapは、UbuntuLinuxの背後にある会社であるCanonicalによって開発された代替のパッケージ管理ツールおよびプログラムパッケージ形式としても知られています。 SnapはUbuntu16.04LTS(Xenial Xerus)で導入されており、それ以降はすべてのUbuntuバージョンの一部であり、すべてのLinuxディストリビューションで使用できます。 Snapパッケージは、コマンドラインからインストールすることも、Webサイトから.snapファイルとしてダウンロードすることもできます。スナップパッケージマネージャーは、パッケージごとに個別のフォルダーを作成し、システムの他の部分に干渉しません。
このチュートリアルでは、Ubuntu20.04にSnapパッケージをインストールして使用する方法を説明します。
- Ubuntu20.04を実行しているサーバー。
- ルートパスワードがサーバーに設定されます。
デフォルトでは、SnapはUbuntuのデフォルトリポジトリで利用できます。次のコマンドでインストールできます:
apt-get install snapd -y
インストールしたら、次のコマンドを使用してスナップのバージョンを確認します。
snap version
次の出力が得られるはずです:
snap 2.48+20.04 snapd 2.48+20.04 series 16 ubuntu 20.04 kernel 5.4.0-29-generic
Snapパッケージリポジトリで利用可能なすべてのパッケージを一覧表示するには、次のコマンドを実行します。
snap find
次の出力が表示されます。
No search term specified. Here are some interesting snaps: Name Version Publisher Notes Summary eks v1.18.9 canonical? classic Amazon EKS Distro (EKS-D) snap thunderbird 78.6.1 canonical? - Mozilla Thunderbird email application sc-controller 0.4.8 njmcphail - Driver, mapper and GUI for Steam Controller, DS4 and similar controllers. netbeans 12.2 apache-netbeans? classic Apache NetBeans IDE geforcenow 1.0.5 popey - GeForce NOW argos-translate 1.0.4 argosopentech - Offline neural machine translation app parsec v2.1.0 touilleman classic Secure cloud framework glow 1.3.0 tbmb - Render markdown on the CLI, with pizzazz! ???????? termius-app 7.4.1 termius? - Cross-platform SSH client camus 0.2.2 mrgnr - Peer-to-peer group video chat using WebRTC. freecad 0.18 vejmarie - This is the freecad 0.18 release supporting OCCT 7 / Netgen and many other features flameshot v0.8.5+git10.376a6f2 borgman-jeremy - Powerful yet simple to use screenshot software signal-desktop 1.39.6 snapcrafters - Signal Private Messenger for Windows, Mac, and Linux stellarium-daily v0.20.4 t4saha - Free, open source planetarium software shutter 0.94.3 popey - Feature-rich screenshot program video-downloader 0.6.8 unrud - Download videos from websites like YouTube and many others vimix 0.4 bruno-herbelin - Live video mixing alfacast 2.6 romanshpuntov - Multiplatform Broadcast Audio / Video Streamer & Viewer of Your Screen uno-calculator 1.2.4-uno.725 unoplatform - The Uno Calculator netcalc 3.2 krupier3301 - Network calculator opera 73.0.3856.344 opera-software? - Fast, secure, easy-to-use browser blender 2.91.2 blenderfoundation? classic Blender is the free and open source 3D creation suite. krop 0.6.0 gocarlos - A tool to crop PDF files icloud-for-linux 0.11 marcustomlinson - iCloud for Linux gitkraken 7.5.0 gitkraken? classic For repo management, in-app code editing & issue tracking. konversation 1.7.4 kde? - IRC client mattermost-desktop 4.6.1 snapcrafters - Open source, private cloud Slack-alternative forkstat V0.02.16 cking-kernel-tools - process fork/exec/exit monitoring tool vlc 3.0.12.1 videolan? - The ultimate media player
次のコマンドを使用して、Snapリポジトリから特定のパッケージを見つけることもできます。
snap find package-name
たとえば、次のコマンドでSkypeパッケージを検索します。
snap find skype
次の出力が得られるはずです:
Name Version Publisher Notes Summary skype 8.67.0.96 skype? classic One Skype for all your devices. New features. New look. All Skype. audio-recorder 3.0.5+rev1432+pkg-7b07 brlin - A free audio-recorder for Linux (EXTREMELY BUGGY) guvcview 2.0.6+pkg-f796 brlin - A simple v4l2 full-featured video grabber spreedme 0.29.5snap1 nextcloud? - Spreed.ME audio/video calls and conferences feature for the Nextcloud Snap ramboxpro 1.4.1 ramboxapp? - Rambox Pro fakecam 2.2.0 diddledan - Fakecam
次のコマンドを使用して、Snapリポジトリで利用可能な任意のパッケージをインストールできます。
snap install package-name
たとえば、VLCをインストールする場合は、次のコマンドを実行します。
snap install vlc
インストールすると、次の出力が得られます。
VideoLANのvlc 3.0.12.1 from VideoLAN? installed
インストールされているパッケージを更新する場合は、次のコマンドを実行します。
snap refresh package-name
すべてのSnapパッケージを一覧表示する場合は、次のコマンドを実行します。
snap list
次の出力が表示されます。
Name Version Rev Tracking Publisher Notes core 16-2.48.2 10583 latest/stable canonical? core core18 20201210 1944 latest/stable canonical? base skype 8.67.0.96 161 latest/stable skype? classic vlc 3.0.12.1 2103 latest/stable videolan? -
Snapによって行われた最近の変更を確認するには、次のコマンドを実行します。
snap changes
次の出力が得られるはずです:
ID Status Spawn Ready Summary 1 Done today at 10:58 UTC today at 10:58 UTC Initialize system state 2 Done today at 11:14 UTC today at 11:15 UTC Install "skype" snap 3 Done today at 11:14 UTC today at 11:15 UTC Initialize device 4 Done today at 11:15 UTC today at 11:16 UTC Install "vlc" snap
Snapパッケージに関する情報を確認するには、次のコマンドを実行します。
snap info vlc
次の出力でVLCパッケージの詳細情報を取得する必要があります。
name: vlc summary: The ultimate media player publisher: VideoLAN? store-url: https://snapcraft.io/vlc contact: https://www.videolan.org/support/ license: GPL-2.0+ 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. snap-id: RT9mcUhVsRYrDLG8qnvGiy26NKvv6Qkd channels: latest/stable: 3.0.12.1 2021-01-23 (2103) 309MB - latest/candidate: 3.0.12.1 2021-01-05 (2103) 309MB - latest/beta: 3.0.12.1-26-g4f8ca0de78 2021-01-20 (2140) 309MB - latest/edge: 4.0.0-dev-14637-g2893809229 2021-01-25 (2149) 359MB ->
システムから特定のSnapパッケージを削除するには、次のコマンドを実行します。
snap remove package-name
たとえば、VLCパッケージを削除するには、次のコマンドを実行します。
snap remove vlc
すべてのSnapファイルは/var/ lib / snapd /snaps/ディレクトリに保存されます。次のコマンドですべてを表示できます:
ls /var/lib/snapd/snaps/
次の出力が表示されます。
core_10583.snap core18_1944.snap partial skype_161.snap
上記の投稿では、UbuntuにSnapパッケージをインストールして管理する方法を学びました。これがシステム内のSnapパッケージの管理に役立つことを願っています。