How to Search, Install, Remove Snap Apps in Command Line

Last updated: April 24, 2024

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.

Twitter

I'm a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to let me know if the tutorial is outdated! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via [email protected] Buy me a coffee: https://ko-fi.com/ubuntuhandbook1 |

9 responses to How to Search, Install, Remove Snap Apps in Command Line

  1. Howdy,

    snap apps cannot access data on network drives due to security reasons I guess. However for mail apps it is inconvenient to NOT be able to select attachments from network drives.

    Can you please explain how this can be achieved?

    Many thanks,
    Andreas

    • Snap app runs in a sandbox environment. It by default has no access to files outside user’s home directory.

      You can however disable the security confinement by installing snap in --classic mode:

      snap install APP_NAME --classic
      • Thanks for that explanation! I’ve don’t use snap often and never looked up what the –classic option did. I’ve tried some development tools that were snap or flatpak and they always seem to not behave as expected due to sandboxing.

  2. Hi,
    This is a small program seen on the Internet to delete old snaps, because when updating a snap, there is no deletion of the old one. Use it with sudo.

    #!/bin/bash
    # Removes old revisions of snaps
    # CLOSE ALL SNAPS BEFORE RUNNING THIS
    set -eu
    LANG=en_US.UTF-8 snap list --all | awk '/disabled/{print $1, $3}' |
        while read snapname revision; do
            snap remove "$snapname" --revision="$revision"
        done
    • hi, you can remove disabled snaps directly with awk without using a while loop in bash.
      The command without the while loop is as follows:

      snap list --all | awk '/disabled/{system("sudo snap remove " $1 " --revision=" $3)}'

      Fernando.

  3. Thanks! This helped me so much! With this info I removed a failed download of VLC, and reinstalled it. Very useful information, and so well explained.

  4. Thanks very helpful .

  5. How do I remove a specific disabled version but leave the current version? For example, suppose I have the following:

    Gimp version 123 disable
    Gimp version 124

    I just want to remove the Gimp version 123 since it’s disbled

    • This can be done by adding ‘revision’ flag in command. The snap list --all command output has a “Rev” column. By specifying the number under that column can remove disabled package. For example:

      snap remove gimp --revision=123

      Note: number 123 in command is not version number but ‘Rev’ value.