This simple tutorial shows how to search for, install, remove, and list installed Snap applications in Ubuntu from command line.
Snap is an universal Linux package format developed by Canonical, the company behind Ubuntu. Though many users hate the Snap apps, it’s hard to keep away from it since many popular applications (e.g., VLC, Spotify, VS Code, Android Studio) offer official Ubuntu binaries through Snap rather than classic deb package.
As Ubuntu Software still sucks and does not load application pages quite often, you can run followings command instead to search for & install snap applications.
1. Searching for Snap Apps in Terminal:
Simply open terminal from system application launcher. You can then either run snap find
or snap search
command follow with app name to query the store for available packages.
Both commands below do the same searching for GIMP packages:
snap find gimp
snap search gimp
For the verified publisher, you’ll see a green check mark after the publisher name.
2. Command to Install a Snap App:
To install a Snap application package, simply run snap install
command follow with the package name.
After searching for an app, you can then select install one from available packages by running command (VLC for instance):
snap install vlc
Some applications support for installing with --classic
flag to access files outside user’s home directory. So, the command could be:
snap install vlc --classic
Usually, we install Snap applications from the stable channel. There are also beta
, edge
, candidate
channels include packages for testing purpose. For example, install VLC from its Beta channel, use command:
snap install vlc --channel beta
3. How to List installed Snap applications:
To list all installed snap applications, simply run snap list
in terminal.
snap list
While “core” and “core18” are snap core packages, “snap-store”, “snap-store-proxy”, and “snap-store-proxy-client” relates to the Ubuntu Software.
All others are user installed packages, though “gnome-3-xxx” packages were installed automatically as dependency platform.
Snap apps update automatically when new release packages published. So, there may be old packages present in your system after using them for a period of time. To list all of them, use command:
snap list --all
Old packages should be marked as ‘disabled’.
4. How to Remove Snap Apps via command:
To remove a snap package, simply run snap remove
command follow with package name.
In the case, I’m going to remove VLC snap package via command:
snap remove vlc
NOTE that the dependency platform (e.g., gnome and wine) won’t to be removed while removing the snap that requires it.
The previous remove command will leave a snapshot of app data on your system. Use --purge
flag will clear all the app data:
snap remove --purge vlc
By running snap list --all
command in terminal, you may see some old versions of app packages left in system marked as “disabled”. To remove one of the disabled package, there’s a ‘revision
‘ flag can do the job. For example, remove chromium marked as rev 2254:
snap remove chromium --revision=2254
Thanks to @Fernando, the command below will free up disk space by removing all the old disabled snap packages:
snap list --all | awk '/disabled/{system("sudo snap remove " $1 " --revision=" $3)}'
Summary:
In brief you can run snap find APP_NAME or snap search APP_NAME to search for available packages. Use snap install PACKAGE_NAME or snap remove PACKAGE_NAME to install or remove an application. And run snap list to list all installed snap applications.