Skip to content
Sam's Blog

Linux

Free Your Linux System from Snap: Boost Performance and Take Back Control

9 min read
Free Your Linux System from Snap: Boost Performance and Take Back Control

Linux, as an operating system, is celebrated for its flexibility, customization, and open-source nature. It empowers users to tailor their computing environment to their exact needs, free from the constraints often imposed by proprietary systems. However, with great power comes great responsibility, and sometimes, that responsibility involves making tough decisions about the tools and packages you use. One such tool that has sparked considerable debate within the Linux community is SNAP.

Developed by Canonical, SNAP is a package management system designed to simplify the installation and management of software on Linux distributions. While it offers undeniable convenience, it has also become a polarizing topic among Linux enthusiasts. Many users have grown frustrated with SNAP’s perceived inefficiencies, its proprietary undertones, and its mandatory integration in some distributions. If you’re one of those users who prefers to remove SNAP, block its installations, and optimize your system’s performance, this guide is for you.

In this blog post, we’ll explore the reasons why some users choose to remove SNAP, provide a step-by-step guide to uninstalling it, and discuss how to block its reinstallation. We’ll also delve into the broader implications of these actions and how they align with the ethos of Linux. Whether you’re a seasoned Linux user or a newcomer, this guide will help you take control of your system and make informed decisions about your software management.


Why Remove SNAP? Understanding the Controversy

Before diving into the technical steps, it’s important to understand why SNAP has become such a contentious topic in the Linux community. Here are some of the key reasons why users choose to remove SNAP:

1. Performance Concerns

SNAP packages are self-contained, meaning they bundle all their dependencies into a single package. While this ensures compatibility across different Linux distributions, it also leads to larger file sizes and slower performance. Many users report that SNAP applications take longer to start compared to their traditional .deb or .rpm counterparts.

2. Proprietary Undertones

Linux users often choose the platform for its open-source philosophy. SNAP, however, is developed and controlled by Canonical, a single entity. This centralization has raised concerns about the erosion of the decentralized, community-driven ethos that Linux is known for.

3. Forced Adoption

In some distributions, such as Ubuntu, SNAP is pre-installed and sometimes used as the default method for installing certain software (e.g., Chromium). This mandatory integration has frustrated users who prefer alternative package managers like APT or Flatpak.

4. Isolation from the System

SNAP packages run in isolated environments, which can be both a blessing and a curse. While this isolation enhances security, it also limits integration with the rest of the system. For example, SNAP applications may not adhere to system-wide theme settings or may have restricted access to hardware.

5. Community Backlash

The Linux community is known for its vocal and passionate user base. Many users have expressed dissatisfaction with SNAP, leading to a growing movement to remove it from their systems. Distributions like Linux Mint have even gone so far as to exclude SNAP entirely from their releases.


The Best and Non-Argumentative Problem Statement Against SNAP

When discussing the issues with SNAP, it’s important to approach the topic in a way that is factual, non-confrontational, and respectful of differing opinions. Here’s a balanced problem statement that outlines the concerns without being argumentative:

“SNAP, as a package management system, introduces a unique approach to software distribution by bundling applications with their dependencies in isolated containers. While this method offers benefits such as cross-distribution compatibility and enhanced security, it also presents challenges that some users find problematic. These challenges include larger package sizes, slower application startup times, and limited integration with the host system. Additionally, the centralized control of SNAP by Canonical has raised questions about its alignment with the open-source principles that many Linux users value. As a result, some users prefer alternative package management solutions that better suit their needs and preferences.”

This statement acknowledges the benefits of SNAP while also highlighting the legitimate concerns that users have. It avoids inflammatory language and respects the fact that different users may have different priorities.


Why Shouldn’t Canonical Force Users to Keep SNAP?

The idea of forcing users to adopt a particular technology goes against the very essence of Linux, which is built on the principles of freedom, choice, and user autonomy. Here’s why Canonical shouldn’t force users to keep SNAP:

1. User Autonomy

Linux users choose the platform because it allows them to have complete control over their systems. Forcing SNAP on users undermines this autonomy and goes against the spirit of Linux. Users should have the freedom to choose the tools and packages that best suit their needs.

2. Diversity of Preferences

The Linux community is incredibly diverse, with users having different preferences, workflows, and priorities. What works well for one user may not work for another. By forcing SNAP, Canonical risks alienating a significant portion of its user base who prefer alternative solutions.

3. Open-Source Philosophy

Linux is built on the principles of open-source software, which emphasize transparency, collaboration, and decentralization. SNAP, being controlled by a single entity (Canonical), feels at odds with these principles. Forcing SNAP on users can be seen as a move towards centralization, which is contrary to the ethos of the Linux community.

4. Potential for Backlash

Forcing SNAP on users can lead to backlash, as we’ve already seen with distributions like Linux Mint opting to exclude it. This not only damages Canonical’s reputation but also fragments the community, which is counterproductive to the growth and adoption of Linux.

5. Alternative Solutions Exist

There are already several well-established package management systems available for Linux, such as APT, Flatpak, and AppImage. These alternatives offer different trade-offs and cater to different user needs. By forcing SNAP, Canonical is effectively limiting the choices available to users, which is antithetical to the Linux philosophy.


Step 1: Removing SNAP Packages

If you’ve decided that SNAP isn’t for you, the first step is to remove all SNAP packages from your system. Here’s how to do it:

1. List Installed SNAP Packages

Open your terminal and run the following command to view a list of installed SNAP packages:

snap list

This will display all the SNAP packages currently installed on your system.

2. Remove Individual SNAP Packages

To remove a specific SNAP package, use the following command:

sudo snap remove --purge package-name

Replace package-name with the exact name of the package you want to remove. The --purge flag ensures that all associated data and configurations are also deleted.

3. Remove the SNAP Cache

After removing all SNAP packages, it’s a good idea to clear the SNAP cache to free up space:

sudo rm -rf /var/cache/snapd/

4. Stop and Unmount SNAP Services

Next, stop the SNAP service and unmount its core service:

sudo systemctl stop snapd
sudo umount /snap/core/<core-id>

To find the core-id, use the df command, which will display the mounted filesystems. Look for the entry related to SNAP and note the core-id.

5. Purge SNAP from Your System

Finally, remove SNAP and its associated components from your system:

sudo apt purge snapd* gnome-software-plugin-snap --auto-remove

This command removes the snapd package, the GNOME software plugin for SNAP, and any unused dependencies.

6. Delete SNAP Directories

To ensure a complete removal, delete any remaining SNAP directories:

sudo rm -rf ~/snap /var/cache/snapd/ /var/snap /var/lib/snapd

Step 2: Blocking SNAP from Your System

Even after removing SNAP, there’s a chance it could be reinstalled automatically when you install certain packages (e.g., Chromium). To prevent this, you can block SNAP from being installed on your system.

1. Using apt-mark to Hold SNAP

One method is to use the apt-mark command to “hold” the snapd package, preventing it from being installed or upgraded:

sudo apt-mark hold snapd

However, this method only prevents automatic upgrades and installations. It won’t stop manual installations.

2. Using Package Pinning

A more effective approach is to use package pinning, which assigns a lower priority to SNAP packages, making them less likely to be installed. To do this, create a preferences file for SNAP:

sudo cat << EOF > /etc/apt/preferences.d/snapd
Package: snapd
Pin: origin *
Pin-Priority: -1
EOF

This file tells the package manager to ignore SNAP packages, even if they’re explicitly requested.

3. Blocking Specific SNAP Packages

If you want to block specific SNAP packages (e.g., Chromium), you can create additional preferences files:

sudo cat << EOF > /etc/apt/preferences.d/snap
Package: snap
Pin: origin *
Pin-Priority: -1
EOF

Step 3: Exploring Alternatives to SNAP

With SNAP removed and blocked, you might be wondering how to manage your software. Fortunately, Linux offers several alternatives:

1. APT (Advanced Package Tool)

APT is the default package manager for Debian-based distributions like Ubuntu. It provides access to a vast repository of software and is highly customizable.

2. Flatpak

Flatpak is a universal package manager that, like SNAP, allows you to install software across different distributions. However, it’s more community-driven and integrates better with system themes and settings.

3. AppImage

AppImage is another universal package format that doesn’t require installation. Simply download the AppImage file, make it executable, and run it.

4. PPAs (Personal Package Archives)

PPAs allow you to install and update software that isn’t available in the official repositories. While they require more manual management, they offer greater control over your software.


Conclusion: Taking Control of Your Linux Experience

The decision to remove SNAP from your Linux system is a deeply personal one. It reflects your values, preferences, and how you choose to interact with your computing environment. While SNAP offers convenience and cross-distribution compatibility, it also comes with trade-offs that may not align with your needs.

By following this guide, you’ve taken a significant step toward reclaiming control over your system. Whether you’re motivated by performance concerns, philosophical objections, or simply a desire to explore alternatives, the power to shape your Linux experience lies in your hands.

Remember, Linux is all about choice. Whether you choose to use SNAP, Flatpak, APT, or another package manager, the most important thing is that your system works for you. Embrace the flexibility that Linux offers, and don’t be afraid to experiment and customize until you find the perfect setup.

In the end, the Linux community thrives on diversity and innovation. By sharing your experiences and insights, you contribute to a richer, more vibrant ecosystem. So go forth, explore, and make your Linux system truly your own.

Recommended for you

View all posts →