Search for available snap packages
To see a list of all available packages in the store, open a terminal
and run the following command:
snap find
To search for a specific package by name, just add your search term to
the end of the snap find command:
snap find name
For a more complete search–searching package descriptions as well as
package names–just pipe the output of the snap find command through
the grep filtering tool, like so:
snap find | grep search
How to install a snap package
To install a snap package, use the following command, specifying the
package by name. Because this makes changes to the system, you have to
add sudo
before the command to run it with root privileges.
sudo snap install package-name
The snap command will download and install the snap package you
specified, displaying the progress in the terminal window.
You can launch the application you installed like any other
application. If it's a graphical application, it should appear in your
desktop's applications menu. Otherwise, just start typing the
application's name at the terminal and press the Tab key to
automatically complete it. You can then press Enter to
launch the application or run the command you installed.
How to update a snap package
To update an installed snap package, run the following command,
specifying the package's name. If a new version of the snap is
available, it will be downloaded and installed.
sudo snap refresh package-name
There doesn't appear to be a command that updates all installed snap
packages at the moment, but we wouldn't be surprised to see one added
in the future.
How to list your installed snap packages
To list your installed snap packages, run the following command
snap list
You can use this command to search your installed packages, too –j ust
pipe the output through grep again:
snap list | grep search
How to remove a snap package
To remove an installed snap package from your computer, run the
following command:
sudo snap remove package-name
View recent changes
Run the following command to view a list of system changes. This
displays a list of the snap packages you've recently installed,
refreshed (updated), and removed, along with the times those
operations took place.
snap changes
See more operations
To see more snap command operations, view the snap command's manual
with the following command. Use the arrow and page up/down keys to
scroll through the manual. press the q key to quit when
you're done.
man snap
In effect, a .deb package includes an executable plus the information needed to install it into the system: where it goes, what it depends upon, etc. Compare this with a snap package, which includes the executable and any necessary dependencies - think of it like static linking of libraries versus dynamically calling in what's installed elsewhere on the system.
The idea is that you could have a stable version A library on the OS, but a new application might demand version B. With a .deb, you'd need to upgrade A, and that might in turn impact some other packages; with snap, the application would come bundled with version B for its sole use, so the system-wide version A remains untouched.
Best Answer
Snap attempts to solve one of the fundamental problems with Linux as a desktop operating system: software availability and software distribution. Snap is not intended to completely replace debs, however. Snaps and Debs work alongside each other.
I am a Linux enthusiast and a project manager of a Linux application. While I love Linux systems as a whole, I can't stand the current state of package distribution. Universal App Formats like Snaps aim to solve this fundamental problem.
In Linux, packages are specifically built for a single version of a single distribution. With a lot of tweaking, it is possible to make one
.deb
package that runs on all Debian based systems, but this is complicated and limits developers. It's also not practical at times due to version locking of dependencies.If I create a deb package for Ubuntu 20.04, it will only work on that version. I also have to make a different package for 16.04, 18.04, 20.10 and so on. I already have to make four packages just for Ubuntu. I also need to make one for every Debian version, every Fedora version and every openSUSE version. RPM is more flexible in this regard but the locked dependency issue still gets in the way.
This means if I want to release a new version of my application, I have to create over 20 packages to cover the majority of Linux distributions, and that still won't cover every distro. A second possibility is to wait for distribution maintainers to add your package to the distribution but this usually takes an absurd amount of time. Moreover, then the distribution maintainers decide which version their users get instead of the software developer.
With Snap, a single package runs on every version of every distribution that supports snap. See Installing snapd for a list of many distros that support it.
Additionally, with Snap, the developer publishes and maintains the package, instead of the distribution maintainer. So I as a developer can release new a version to all my users without having to wait on anyone else.
Essentially, everything I hate about Linux package distribution is solved by Snap. Though it's important to note that these core issues are also being solved by Flatpaks & to a degree by AppImages. The discussion for which format is better is highly debated and a much longer conversation than makes sense for this reply. For now, I will say that I am fine with running any of the universal formats since they all work differently and thus do not conflict with each other making it possible to run all 3 and traditional packages at the same time.
TL;DR
Linux package distribution is awful for both developers and users. Snaps, Flatpaks & AppImages are intended to solve this fundamental problem with Linux based systems.
This question is really about why the move but if anyone is interested in learning more about what Snaps are and how they work. I created this video to explain the structure in-depth.