Enable or Disable Snap in Linux Mint 20

How to Enable or Disable Snap in Linux Mint 20

As you may know, the snap support is disabled by default in the Linux Mint 20. The apt package manager is prevented from using and installing span packages, and there is no span management tools installed out of the box. If you decided to go with a snap app, here is how to enable the snap support in Linux Mint.

Linux Mint 20 Cinnamon Desktop

The Linux Mint team doesn't like the idea behind the snap protocol and the way it is implemented by Canonical.

The Snap Store is exclusively controlled by Canonical. It is a centralized software source. While Snap is open-source, it only works with the Ubuntu Store. You cannot create your own store, and uses a closed protocol to deliver updates. This means that Snap client works only with one store, and nobody can create his own store for redistributing span packages.

On other hand, Snap is similar to AppImage or Flatpak the Snap Store. It can be used to deliver up-to-date apps regardless of what version of Linux you are running and how old it is. The store lockdown issue of snap doesn't allow devs to audit, patch, or modify software it contains. It makes it similar to proprietary software.

These are the reasons the Linux Mint team has the span tools disabled in Mint 20.

If you are not happy with their decision, and need to use snap, it is still possible to unlock it.

To Enable Snap in Linux Mint 20,

  1. Open terminal as root.
  2. Type the following command: # rm /etc/apt/preferences.d/nosnap.pref. This will enable Snap.
  3. Now, update the package cache for apt with this command: # apt update.
  4. Finally, install the snapd package: # apt install snapd.

Note: Do not enter the # portion. It is just an indicator for the root console in which you have to type the commands above.

You are done! The snap tools are now enabled.

Later, you may change your mind and block the snap tools again.

In this case, you need to restore the /etc/apt/preferences.d/nosnap.pref. Here is how it can be done.

To Disable Span in Linux Mint 20

  1. Open terminal as root.
  2. Remove the snapd package: #apt purge snapd.
  3. Execute the following command: # echo 'Package: snapd' > /etc/apt/preferences.d/nosnap.pref.
  4. Now, run the command Pin: # echo 'release a=*' >> /etc/apt/preferences.d/nosnap.pref.
  5. Finally, run the following command: # echo 'Pin-Priority: -10' >> /etc/apt/preferences.d/nosnap.pref.
  6. Verify that you have everything done correctly by viewing the file contents with the command # cat /etc/apt/preferences.d/nosnap.pref​. It should contain all the three lines.
    Package: snapd
    Pin: release a=*
    Pin-Priority: -10
  7. Now, update the package cache for apt with this command: # apt update.

You are done.

You can check what's new in Linux Mint 20 here:

Linux Mint 20 is out, you can download it now

 

2 thoughts on “Enable or Disable Snap in Linux Mint 20

  1. henry price

    Open terminal as root:

    sudo su #this is bad practice, and inherently wrong… you should be using sudoers and ‘sudo su’ will not give you login-specific resource files such as .bash_profile .profile or .login and will be read by the shell. Neither will it drop yo u into the root ~. this will place you in the current working directory you were in prior to running sudo and enable you delete any files without any recourse whatsoever.

    If this is required sudo -i or sudo -s (gives you the root user shell) would be more optimal…however you should be reading the man pages before running random commands online with no or little knowledge.

    Type the following command:

    rm /etc/apt/preferences.d/nosnap.pref – why are you deleting this file to later rely on it for recovery?

    To disable snapd again:

    Open terminal as root:

    sudo su – we’re already logged in as root, says it all really.

    These steps are how not to run escalated privilege tasks in any Linux distro.

    Lesson to learn, do not run commands you have no idea about because someone blogged out it.

    Reply
    1. Sergey Tkachenko Post author

      1. OK, I agree about the environment files/interactive shell. However, in this very case, it doesn’t change things. Just to remove the file, even sudo su is OK.
      2. > why are you deleting this file to later rely on it for recovery
      Why not? I am not going to recover it if I need snap in Mint. Anyway, the recovery steps are below.
      3.> sudo su – we’re already logged in as root, says it all really.
      We are not.
      4.> do not run commands you have no idea about because someone blogged out it.
      That’s a good tip for everyone. Even if I find it a bit toxic in this context.
      Anyway, thanks for your comment. I will update the root terminal article. There is always a way improve your posts.

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *