36 Popular Snap Command Examples in Linux For Beginners - CyberITHub
36 Popular Snap Command Examples in Linux For Beginners - CyberITHub
MORE
Ansible Synopsis
Snap command examples in Linux
AWS Example 1: How to Check Snap command version
Azure Example 2: How to Install a Snap
Example 3: How to Update a snap
Bash
Example 4: How to Remove a Snap
C Example 5: How to List all the available Updates
Example 6: How to List all the Installed Snaps
C#
Example 7: How to Install a Snap using different Channel
C++ Example 8: How to Check all the information about a Snap
Example 9: How to find a package using snap command
Chef
Example 10: How to revert back a Snap version
Cloud Example 11: How to Disable a Installed Snap
Example 12: How to Enable a Installed Snap
Database
Example 13: How to Remove a Snap from System
DevOps Example 14: How to List all the revisions of a Snap
Example 15: How to List all the Snap Changes
Docker
Example 16: How to List all Interface Connections of a Snap
Docker Example 17: How to only download a Snap
To check the snap utility version, you need to use snap --version How to Install
command as shown below. Meld on Ubuntu
20.04 LTS (Focal
Fossa)
root@localhost:~# snap --version
snap 2.50.1 How to Install
snapd 2.50.1 pgAdmin 4 on
series 16
Ubuntu 20.04 LTS
ubuntu 20.04
kernel 5.8.0-55-generic (Focal Fossa)
AiOGajo on
[Solved]: -bash:
/etc/iptables/iptab
Example 6: How to List all the Installed Snaps
les.rules: No such
You can use snap list command to list all the installed snaps in file or directory
your System as shown below.
Ian on How to
Install QEMU on
Ubuntu 20.04 LTS
root@localhost:~# snap list
Name Version Rev Tracking Publisher Notes (Focal Fossa)
chromium 91.0.4472.101 1628 latest/stable canonical* -
polina on Solved
core 16-2.50.1 11167 latest/stable canonical* core
core18 20210507 2066 latest/stable canonical* base "git add shows
gnome-3-28-1804 3.28.0-19-g98f9e67.98f9e67 145 latest/ unable to index
gnome-3-34-1804 0+git.3556cb3 72 latest/stable/… canon
file Permission
gtk-common-themes 0.1-52-gb92ac40 1515 latest/stable/…
postman 8.5.1 140 v8/stable postman-inc* - denied" error
snap-store 3.38.0-63-g766b86f 542 latest/stable/… cano
snapd 2.50.1 12057 latest/stable canonical* snapd
LET’S
KEEP
Example 7: How to Install a Snap using different Channel IN
There are multiple different channels available through which you
TOUC
can install a Snap. It is stable, edge, beta and candidate. By
H!
default when we install a snap, it gets installed from stable We’d love
to keep
channel. you
updated
In this example, we are installing postman through multiple with our
latest
different channel. If you want to install postman through edge
articles
channel then you need to use snap install --edge postman
command as displayed below.
First
Name *
root@localhost:~# snap install --edge postman First Nam
postman (v8/edge) 8.5.1 from Postman, Inc. (postman-in
Last
Name
If you want to install postman through beta channel, then you need
to use snap install --beta postman command as shown below. Last Nam
Email
root@localhost:~# snap install --beta postman Address
postman (v8/stable) 8.5.1 from Postman, Inc. (postman- *
Channel v8/beta for postman is closed; temporarily for
Email Ad
If you want to see complete information about a snap then you need
to use snap info <snap_name> syntax. In this example, we are
listing all the information about postman using snap info postman
command as shown below.
If you want to find a snap, then you need to use snap find
<snap_name> syntax to find that snap. In this example, we are
looking for postman using snap find postman command as
displayed below.
In case you don't want to use a snap, you can simply disable it by
using snap disable <snap_name> syntax. In this example, we are
disabling postman snap using snap disable postman command.
In case you want to enable the disabled snap then you need to use
snap enable <snap_name> syntax. In this example, we are
enabling the disabled snap postman using snap enable postman
command as shown below.
If you want to remove a snap from System then you need to use
snap remove postman command as displayed below.
If you want to check all the available revisions of a snap then you
need to use snap list --all <snap_name> syntax. In this
example, we are checking all the revisions of chromium using snap
list --all chromium command as shown below.
You can also check all the snap operations you have done using snap
changes command as displayed below.
To list all the interface connections of a snap, you need to use snap
connections <snap_name> syntax. In this example, we are listing
all interface connections of postman snap using snap connections
postman command as displayed below.
If you do not want to install a snap and only want to download that
snap then you can use snap download <snap_name> syntax. In this
example, we are downloading postman snap using snap download
postman command as shown below.
If you want to check snap model details then you need to use snap
model command as shown below.
If you want to check the current status of a service, then you can use
snap services <service> syntax. In this example, we are
checking the status of lxd service using snap services lxd
command as shown below.
If you want to restart a snap service then you need to use snap
restart <service_name> syntax. In this example, we are
restarting lxd service using snap restart lxd command as
displayed below.
If you want to stop a snap service then the syntax you need to use is
snap stop <service_name>. In this example, we are stopping lxd
service using snap stop lxd command as displayed below.
If you want to check the logs of a service, then you need to use snap
logs <service_name> syntax. In this example, we are checking the
logs of lxd service by using snap logs lxd command as shown
below.
If you want to create an alias of a snap then the syntax you need to
use is snap alias <snap_name> <snap_alias>. In this example,
we are creating alias of chromium using snap alias chromium
chro command as displayed below. Here chro is the alias of
chromium.
In case you want to take the snapshot of all the installed snaps, then
you need to use snap save command as displayed below.
After taking a snapshot, you can also verify it by using snap check-
snapshot <snapshot-id> syntax. In this example, we are verifying
snapshot Id 8 by using snap check-snapshot 8 command as shown
below.
If you are planning to restore a snapshot then you need to use snap
restore <snap_id> syntax. In this example, we are restoring
Snapshot ID 8 using snap restore 8 command as shown below.
If you want to delete a snapshot then you need to use snap forget
<snapshot_Id> syntax. In this example, we are deleting snapshot of
ID 8 using snap forget 8 command as shown below.
If you want to query a specific snapshot then you need to use snap
saved --id=<snapshot_id> syntax. In this example, we are
querying Snapshot ID 9 using snap saved --id=9 command as
shown below.
To list all the snap aliases, you need to use snap aliases command
as displayed below.
If you want to remove an alias of a snap then you need to first find
that alias from snap aliases command. Then you can remove it by
using snap unalias <snap_alias> syntax. In this example, we are
removing alias of chromium snap by using snap unalias chro
command as shown below.
In case you want to login to snapd and snap store, you can use snap
login command and provide your valid Email ID and password to
authenticate.
Email address:
Example 33: How to Log out from snapd and snap store
To log out from snapd and snap store, you can use snap logout
command as shown below.
Example 35: How to Check all the options available with snap
command
If you want to check all the options available with snap command,
then you need to use snap --help command as shown below.
If you want to check the Man page of snap command, then you need
to use man snap command as displayed below.
NAME
snap - Tool to interact with snaps
SYNOPSIS
snap [OPTIONS]
DESCRIPTION
The snap command lets you install, configure, refresh
enabling secure delivery and operation of the latest a
OPTIONS
COMMANDS
abort
Abort a pending change
MORE, Linux
Leave a Comment
Name *
Email *
Website
Save my name, email, and website in this browser for the next
time I comment.
Post Comment