Managing snap packages on Ubuntu
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 findTo search for a specific package by name:
snap find nameFor a more complete search that includes package descriptions, you can pipe the output of snap find through the grep filtering tool:
snap find | grep searchInstalling 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-nameThe 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-nameCurrently, 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 listYou can also search your installed packages by piping the output through grep:
snap list | grep searchRemoving Snap packages
To remove an installed Snap package from your system, use the snap remove command.
sudo snap remove package-nameViewing recent changes
To see a list of recent system changes related to Snaps, including installations, updates, and removals, use the snap changes command.
snap changesSeeing more Snap operations
For more details on available snap command options, you can view the command’s manual page.
man snapUse 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.