Skip to Content

How to install Snapd on Ubuntu?

How to install Snapd on Ubuntu?

Snaps are containerized software packages that are easy to install, update, and remove on Ubuntu. Snapd is the tool that manages snaps on Ubuntu systems. To install snaps on Ubuntu, you first need to install Snapd. This article provides step-by-step instructions on how to install Snapd on Ubuntu.

What is Snapd?

Snapd is a system daemon that runs on Ubuntu and other Linux distributions to manage snaps. It provides a command line and D-Bus interface for interacting with snaps. Snap packages use SquashFS file systems and when installed, mounts them to provide containerized applications. Snapd handles the installation, updating, and Rollbacks of snap packages.

Why Use Snaps?

Here are some key advantages of using snaps on Ubuntu:

  • Automatic updates – Apps installed as snaps get automatic security and feature updates directly from the publisher.
  • Isolation – Each snap runs isolated in its own sandbox and uses separate resources. This improves security and avoids conflicts between apps.
  • Flexibility – Snaps work across many Linux distributions like Ubuntu, Debian, Arch, etc. This provides a consistent experience across platforms.
  • Easy Reverts – If an update causes issues, snaps make reverting to the previous working version straightforward.
  • Secure – All snap packages are cryptographically signed and verified. This prevents tampered or corrupted apps.
  • Dependable – Dependency issues are handled by the snap system and not the user.

These benefits make snaps the preferred way to install apps on Ubuntu desktops and servers.

Requirements for Installing Snapd

To install and run Snapd on your Ubuntu system, you need:

  • Ubuntu 16.04 or higher – Snapd is installed by default on Ubuntu 16.04 and above. For older Ubuntu versions, you’ll need to manually install Snapd.
  • Root privileges – You need root privileges to install, update, and manage snaps on Ubuntu. Use sudo when running Snapd commands.
  • An internet connection – To download snaps from the Snap Store and receive updates, an active internet connection is required.

As long as your Ubuntu version meets the minimum requirement and you have an internet connection and root access, you can proceed with installing Snapd.

How to Install Snapd

If you’re using Ubuntu 16.04 or later, Snapd should already be installed. You can verify it with:

snap version

If Snapd is installed, this will print the version number. If not, you’ll see an error like “snap not found”.

If Snapd isn’t already installed, use these steps to install it:

  1. Open a terminal window or SSH into your Ubuntu server.
  2. Update your package index with:
    sudo apt update
    
  3. Install Snapd:
     
    sudo apt install snapd
    
  4. Enable classic snap support:
    sudo snap install core
    
  5. Reboot your system to ensure Snapd can run correctly.

The snapd package and its dependencies will be installed on your system. After rebooting, Snapd will be fully functional.

How to Use Snapd

With Snapd installed, you can now install, update, and manage snaps on Ubuntu. Here are common Snapd commands:

Install Snaps

Search for snaps in the Snap Store and install them with:

sudo snap install app_name

For example, to install the Slack snap:

sudo snap install slack

List Installed Snaps

snap list

This displays all installed snaps along with the version and tracking info.

Update Snaps

sudo snap refresh

This updates all snaps to the latest version. You can also update individual snaps by specifying the name.

Remove Snaps

sudo snap remove app_name

This will uninstall and remove the snap from your system.

Snapd has additional commands like info, services, switches, set, connect and more for managing snaps. Refer to the Snapd documentation to learn more.

Snapd Configuration File

The Snapd configuration options are stored in /etc/systemd/system/snapd.service.d/override.conf. This allows customizing Snapd behavior like:

  • Enabling or disabling automatic refresh for installed snaps.
  • Adjusting snapd timeouts.
  • Setting proxy configuration.
  • Controlling kernel and gadget updates.

Refer to the snapd.conf manual page for details on available configuration options.

Troubleshooting Snapd Issues

Here are solutions for common Snapd issues on Ubuntu:

Snapd Errors on Older Ubuntu Versions

On Ubuntu 14.04 or earlier, you may see errors like “snapd not found” or “command not found”. In this case, you need to update to Ubuntu 16.04 or later where Snapd is officially supported.

Perission Denied Errors

Running Snapd commands without sudo can cause “permission denied” errors. Always use sudo or run commands as root when installing/managing snaps.

Connection Refused Errors

A “connection refused” error points to Snapd not being able to reach the Snap Store. Check your internet connection or try switching networks. Also make sure you have rebooted after installing Snapd.

Held Broken Packages

Attempting to install Snapd when you have held broken packages on Ubuntu can cause installation failures. Run “sudo apt-get install -f” first to fix broken packages before installing Snapd.

System Slowdowns from Snaps

Opening many snaps at the same time can sometimes cause temporary system slowdowns. Restarting the system typically resolves this. Also consider using –devmode when installing snaps for development purposes.

Conclusion

Installing Snapd on Ubuntu provides access to thousands of apps as snaps that are isolated, auto-updating, and tamper-proof. After installing Snapd from the Ubuntu repositories, you can search, install, update and remove snaps with easy commands. Following the steps in this guide will get you up and running with snaps to enhance your Ubuntu desktop or server.