Ricerca nel sito web

Come installare e utilizzare Snap Package Manager su Ubuntu 20.04


Su questa pagina

  1. Prerequisiti
  2. Installa Snap
  3. Elenca i pacchetti Snap
  4. Trova un pacchetto specifico con Snap
  5. Installa un pacchetto con Snap
  6. Lavorare con Snap
  7. Conclusione

Snap noto anche come Snappy è uno strumento di gestione dei pacchetti alternativo e un formato di pacchetto di programmi sviluppato da Canonical, la società dietro Ubuntu Linux. Snap è stato introdotto in Ubuntu 16.04 LTS (Xenial Xerus) e da allora fa parte di qualsiasi versione di Ubuntu, può essere utilizzato su tutte le distribuzioni Linux. I pacchetti snap possono essere installati tramite riga di comando o possono essere scaricati da siti Web come file .snap. Snap Package Manager crea una cartella separata per ogni pacchetto e non interferisce con il resto del sistema.

In questo tutorial, ti mostreremo come installare e utilizzare il pacchetto Snap su Ubuntu 20.04.

Prerequisiti

  • Un server che esegue Ubuntu 20.04.
  • Il server è configurato con una password di root.

Installa Snap

Per impostazione predefinita, Snap è disponibile nel repository predefinito di Ubuntu. Puoi installarlo con il seguente comando:

apt-get install snapd -y

Una volta installato, verifica la versione di Snap utilizzando il seguente comando:

snap version

Dovresti ottenere il seguente output:

snap    2.48+20.04
snapd   2.48+20.04
series  16
ubuntu  20.04
kernel  5.4.0-29-generic

Elenca i pacchetti Snap

Per elencare tutti i pacchetti disponibili nel repository dei pacchetti Snap, eseguire il seguente comando:

snap find

Dovresti vedere il seguente output:

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

Trova un pacchetto specifico con Snap

Puoi anche trovare un pacchetto specifico dal repository Snap con il seguente comando:

snap find package-name

Ad esempio, trova un pacchetto Skype con il seguente comando:

snap find skype

Dovresti ottenere il seguente output:

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

Installa un pacchetto con Snap

Puoi installare qualsiasi pacchetto disponibile nel repository Snap con il seguente comando:

snap install package-name

Ad esempio, se desideri installare VLC, esegui il seguente comando:

snap install vlc

Una volta installato, dovresti ottenere il seguente output:

vlc 3.0.12.1 from VideoLAN? installed

Se desideri aggiornare il pacchetto installato, esegui il seguente comando:

snap refresh package-name

Lavorare con Snap

Se vuoi elencare tutti i pacchetti Snap, esegui il seguente comando:

snap list

Dovresti vedere il seguente output:

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?   -

Se vuoi vedere le modifiche recenti apportate da Snap, esegui il seguente comando:

snap changes

Dovresti ottenere il seguente output:

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

Se vuoi vedere le informazioni sul pacchetto Snap, esegui il seguente comando:

snap info vlc

Dovresti ottenere informazioni dettagliate sul pacchetto VLC nel seguente output:

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 -

Per rimuovere uno specifico pacchetto Snap dal tuo sistema, esegui il seguente comando:

snap remove package-name

Ad esempio, per rimuovere il pacchetto VLC eseguire il seguente comando:

snap remove vlc

Tutti i file Snap sono memorizzati nella directory /var/lib/snapd/snaps/. Puoi vederli tutti con il seguente comando:

ls /var/lib/snapd/snaps/

Dovresti vedere il seguente output:

core_10583.snap  core18_1944.snap  partial  skype_161.snap

Conclusione

Nel post sopra, hai imparato come installare e gestire i pacchetti Snap su Ubuntu. Spero che questo ti aiuti a gestire il pacchetto Snap nel tuo sistema.