sodcalculator

10 Tech How-To

Install Snap Applications on Arch Linux

Guide 10-52192 · Updated · Step by step

Yes, you can install Snap applications on Arch Linux, but it requires a few extra steps compared to other distributions. This guide walks you through enabling Snap support, installing your first Snap package, and addressing common issues you might encounter along the way.

What Is Snap and Why Use It on Arch?

Snap is a software packaging and deployment system developed by Canonical, the company behind Ubuntu. It bundles applications with their dependencies into a single, self-contained package that runs on many Linux distributions. For Arch users, Snap offers access to software that may not be in the official repositories or the Arch User Repository (AUR), and it simplifies installation of proprietary or less common applications. However, Arch’s philosophy favors simplicity and user control, and Snap’s automatic updates and confinement model can feel at odds with that. Still, many users appreciate the convenience of Snaps for specific tools like Spotify, Slack, or Visual Studio Code.

Prerequisites: Enabling Snap Support

Arch Linux does not enable Snap by default. You need to install the snapd package from the official repositories and enable its systemd service. Here are the steps:

  1. Install snapd: sudo pacman -S snapd
  2. Enable the main socket: sudo systemctl enable --now snapd.socket
  3. For classic confinement support (needed for some snaps like Visual Studio Code), create a symlink: sudo ln -s /var/lib/snapd/snap /snap
  4. Log out and back in, or restart your shell, so that /snap/bin is added to your PATH.

After these steps, you can test the installation with snap version. If you see version information, Snap is ready.

Installing Your First Snap

Once snapd is running, installing an application is straightforward. The basic command is:

sudo snap install <package-name>

For example, to install the Spotify client, run sudo snap install spotify. Snap will download the package and place it in its own confined environment. After installation, the application appears in your application menu, and you can launch it from the terminal by typing its name (e.g., spotify).

Some snaps require “classic” confinement, which gives them more access to your system. These are installed with the --classic flag, like sudo snap install code --classic. Without the symlink from step 3, classic snaps will fail to install.

Managing Snap Updates and Removals

Snaps update automatically in the background by default. You can view the update status with snap changes or manually refresh a specific snap with sudo snap refresh <package-name>. To remove a snap, use sudo snap remove <package-name>. If you want to disable automatic updates entirely, you can set a refresh timer with sudo snap set system refresh.timer=manual, but be aware that this leaves your snaps without security patches until you manually refresh.

Common Problems and How to Fix Them

Users often encounter a few issues when using Snap on Arch:

  • Snap command not found: This usually means /snap/bin is not in your PATH. Add it by editing your shell profile (e.g., ~/.bashrc) and adding export PATH="/snap/bin:$PATH".
  • Classic snaps fail with “cannot mount” errors: This often indicates that the /snap symlink is missing. Recreate it with the command in the prerequisites section.
  • Snap applications don’t start: Check if the snapd service is running with systemctl status snapd. If it’s not active, start it with sudo systemctl start snapd.
  • Slow first launch: The first time you run a snap, it may take longer because it needs to set up its environment. This is normal.

Snap vs. Native Arch Packages vs. Flatpak

Arch Linux users have several ways to install software, and it’s worth knowing the trade-offs.

  • Official repositories (pacman): These are compiled for Arch and integrate seamlessly with the system. They are fast, lightweight, and respect Arch’s rolling-release model. However, they may not always have the latest version of every application.
  • Arch User Repository (AUR): A community-driven repository with thousands of packages. You can build from source or use an AUR helper like yay. This gives you flexibility but requires manual intervention and can break if the PKGBUILD is outdated.
  • Snap: Offers easy installation of proprietary and third-party apps, with automatic updates. The downside is that snaps are larger, can be slower to start, and may have integration issues with your desktop theme or system fonts.
  • Flatpak: Another sandboxed packaging system, popular on Fedora and many other distros. Flatpaks are available on Arch via the flatpak package. They share a similar concept to Snap but use a different runtime model and are often preferred for their desktop integration.

For most Arch users, the official repos and AUR are sufficient. If you need a specific app that’s only available as a snap, then Snap is a valid choice, but you might also check if the same app is available as a Flatpak or in the AUR.

Security and System Impact

Snaps are designed to be sandboxed, meaning they run in an isolated environment with limited access to your system. This is a security benefit, but it can also cause functionality issues—for example, a snap may not be able to read files outside your home directory unless you grant it permission. On Arch, the kernel’s AppArmor support is not enabled by default, so snaps rely on a different confinement mechanism (seccomp) which is still effective but less strict. Be aware that running snaps on Arch may give them slightly more access than on Ubuntu, where AppArmor is active.

In terms of disk space, snaps are self-contained, so they can take up several hundred megabytes each. If you install many snaps, you’ll notice the storage usage. You can check the size with du -sh /var/lib/snapd/snaps/* and remove old versions with sudo snap set system refresh.retain=2 to keep only the last two versions.

Frequently Asked Questions

Is Snap supported on Arch Linux officially?

Snap is not part of the official Arch Linux release, but the snapd package is available in the official repositories. This means it’s maintained by Arch developers, but it’s not a default component. You have to install and enable it yourself, and you should be comfortable with the fact that it may not integrate perfectly with all Arch setups.

Why do I get “error: cannot communicate with server” when running snap?

This error usually means the snapd service isn’t running. Start it with sudo systemctl start snapd and enable it to start at boot with sudo systemctl enable snapd. If it still fails, check the service logs with journalctl -u snapd for details.

Can I use Snap and Flatpak together on Arch?

Yes, you can install both. They are independent systems and will not conflict. You can use Snap for apps that are only available there, and Flatpak for others. Just be aware that you’ll have two separate package managers and update mechanisms, which can be a bit overwhelming.

How do I uninstall snapd completely?

First, remove all installed snaps with sudo snap remove --purge <package> for each snap. Then remove the snapd package with sudo pacman -Rns snapd. Finally, delete the leftover directories: sudo rm -rf /var/lib/snapd /snap ~/snap. Make sure to also remove the symlink if you created one.

Are snaps slower than native packages on Arch?

In many cases, yes. Because snaps are self-contained and use a different filesystem layout, they can have slower startup times and higher memory usage. For lightweight tools, the difference is negligible, but for large applications like browsers, you might notice a delay. If performance is critical, consider using the native package or a Flatpak, which may be more optimized.

Can I install a snap without sudo?

No, installing a snap system-wide requires root privileges. However, you can use the --user flag with snap install to install a snap only for your user, but this is only supported for certain snaps and requires the snap to be designed for user installation. In practice, most snaps require system-wide installation.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →