Help Docs Server Administration Linux Server Administration Managing snap packages on Ubuntu

Managing snap packages on Ubuntu

Learn to manage Snap packages on Ubuntu. Discover how to find, install, update, list, and remove these self-contained applications via `snap`.

Starting with Ubuntu 16.04, Snap packages were introduced as a new way to install applications. Unlike traditional .deb packages managed by tools like apt-get and dpkg, Snaps require different commands.

Snaps are similar to containers. They are self-contained, meaning they include all the libraries and dependencies they need to function. Snap applications are sandboxed, installing to their own directory and designed not to interfere with the rest of your system. Snap files have the extension .snap.

Searching for Snap packages

To find applications available as Snap packages, you can search the Snap store.

To see a list of all available packages:

snap find

To search for a specific package by name:

snap find name

For a more complete search that includes package descriptions, you can pipe the output of snap find through the grep filtering tool:

snap find | grep search

Installing Snap packages

To install a Snap package, you use the snap install command. Because this command makes changes to the system, you need to run it with root privileges using sudo.

sudo snap install package-name

The snap command will download and install the specified package, showing the progress in the terminal. Once installed, you can launch the application like any other.

Updating Snap packages

To update an installed Snap package, you use the snap refresh command, specifying the package’s name. If a newer version is available, it will be downloaded and installed.

sudo snap refresh package-name

Currently, there doesn’t appear to be a single command to update all installed Snaps at once, but this might be added in the future.

Listing installed Snaps

You can see which Snap packages are installed on your server.

To list all installed Snap packages:

snap list

You can also search your installed packages by piping the output through grep:

snap list | grep search

Removing Snap packages

To remove an installed Snap package from your system, use the snap remove command.

sudo snap remove package-name

Viewing recent changes

To see a list of recent system changes related to Snaps, including installations, updates, and removals, use the snap changes command.

snap changes

Seeing more Snap operations

For more details on available snap command options, you can view the command’s manual page.

man snap

Use the arrow and page up/down keys to scroll and press “q” to quit. Ubuntu developers are likely to continue developing the Snap format and tools, so more options may be added in the future.

Was this article helpful?