Uninstalling Snapd on Ubuntu

Removing snapd from Ubuntu can be an essential step for users who prefer a leaner system or wish to rely exclusively on traditional package management tools like APT. Snap packages and the Snap package manager offer a convenient way to distribute and install applications across various Linux distributions. However, not everyone finds the additional layer beneficial, leading some to opt for its removal. This guide provides a comprehensive walkthrough for safely removing snapd and its associated packages from your Ubuntu system.

In this tutorial you will learn:

  • How to list all currently installed snap packages
  • Steps to remove all installed snap packages
  • How to purge snapd from your system
  • Methods for cleaning up remaining directories and unused packages
  • The importance of rebooting your system after removal
Uninstalling Snapd on Ubuntu
Uninstalling Snapd on Ubuntu
Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Ubuntu Linux
Software None
Other None
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

Removing Snapd from Ubuntu

Before proceeding with the removal of snapd, it’s important to understand the steps involved in this process. By following the instructions below, you’ll ensure that snapd and its components are properly removed from your Ubuntu system.

  1. List Installed Snap Packages: Begin by listing all currently installed snap packages. This step helps you identify what will be removed.
    $ snap list

    This command displays a list of installed snap packages, helping you understand which applications are currently managed through snapd.

    List Installed Snap Packages
    List Installed Snap Packages



  2. Remove Snap Packages: Next, remove all snap packages. Note that base packages and snapd itself cannot be removed at this stage. Focus on removing what you can.
    $ sudo snap remove <package name>

    For example, to remove Firefox, you would execute:

    $ sudo snap remove firefox

    This step ensures that all non-snap and user-installed snap packages are removed from your system.

  3. Purge Snapd: Now, remove the snapd package itself using the purge option.
    $ sudo apt purge snapd

    This command not only removes snapd but also deletes its configuration files.

  4. Cleanup and Remove Remaining Directories: Clean up any remaining directories and unused packages:
    $ rm -rf ~/snap
    $ sudo rm -rf /var/snap
    $ sudo rm -rf /var/lib/snapd

    These commands remove leftover directories, ensuring no traces of snap remain.

  5. Reboot Your System: Finally, reboot your system to ensure all changes take effect.
    $ sudo reboot

    Rebooting is an important step to finalize the removal process and refresh your system’s state.

Conclusion

By following these steps, you have successfully removed snapd and all associated snap packages from your Ubuntu system. This guide aimed to provide a detailed and safe approach to uninstalling snapd, helping you return to a traditional package management system or simply declutter your system. Remember that while snap packages offer convenience, not all users require the functionality they provide, making their removal a valid option for many.