from Hacker News

Disabling Snaps in Ubuntu 20.04

by temeritatis on 4/24/20, 8:36 PM with 422 comments

  • by jaytaylor on 4/24/20, 8:52 PM

    Kudos to the OP, I'm glad this got posted on hacker news because Snap is so ridiculously broken.

    Since 16.04, Snaps have been a huge pain for me with running LXC in production environments.

    By default, Snap applies updates and restarts Systemd services anytime it likes, and there's no way to turn this behavior off! The only way to get around it is to download the Snap package binary and install that directly. Then Snap won't "know" where to get updates.

    (Caveat emptor: "Workarounds" like this can easily lead to a bad security scenario, since any critical security patches won't be installed by any standard system update process)

    Did I mention that a fair percentage of the time the Snap updates would leave LXC in a completely broken state? In production (and development, too)!

    The final nail in the coffin in this scenario comes in the form of Snap being the official recommended way to install LXC. I don't know if Stéphane and friends even publish Debian packages anymore.

    I get the idea behind snap and appreciate it, but the lack of configurability and no clear definition of what stable really even means . . .

  • by psanford on 4/24/20, 9:08 PM

    I really like the idea of snaps. I really don't like a lot of the execution decisions around them.

    Snaps break debain's stable release model. They allow upstream to ship updates outside of the normal 6 month ubuntu releases. There are times when you might want this, but it should be opt in not mandatory. I thinking specifically of lxd which is only shipped via snaps.

    The snap store's trust model is confusing. Its hard to tell who is making the packages and how they are sandboxed. If I'm going to install a proprietary piece of software I want to know exactly what it can and can't do. Lately I've been using firejail when I need to run things like this.

    And now for a minor complaint that also feels most user hostile to me: why do the snap developers think its ok to require a non hidden directory in $HOME? Seriously my home directory is MINE, if you have to store application state there at least have the decency to do it in a hidden directory.

  • by AlexMax on 4/24/20, 9:29 PM

    I wanted to like snaps (and flatpaks before then), because trying to ease packaging and deployment of apps on Linux is a noble goal, but in both cases I eventually gave up on non-trivial use of them because they were always broken in some annoying way because of their sandboxing.

    The latest snap I had to get rid of was Visual Studio Code, because I was trying to work on an open source game with it, and I found out that if I launched the game from inside Visual Studio Code, my game wouldn't play sounds because it couldn't communicate with PulseAudio, and attempting to use ALSA just straight up gave me an error.

    On the other hand, I've only had positive experiences with AppImage. Gives you an all-in-one image that you can directly execute if you like, and no sandboxing nonsense.

  • by Darmody on 4/24/20, 10:33 PM

    I've been using Ubuntu 20.04 for several weeks, almost since beta came out.

    The snap thing is a pain in the ass. I understand the need for something like snap or flatpak. I had software too new or too old that wouldn't work because some dependencies were not updated or were too new. Snaps can solve that by allowing the developers to provide everything you need (or everything you need that is not on your system). But why would I want a snap calculator or a snap system monitor? On 19.04 it would take a couple seconds to open the calculator...thank god they reverted those apps as normal packages.

    Now I feel like I felt on Windows when I had to be extra careful installing software in case somethign weird came in the installer. What kind of package is this? Is it a snap? Can I install the normal package? Is the snap provided by someone trustworthy?

    I also had to install Unity. Gnome lacks support for multiple monitors. Some stuff like the dash working only on the main monitor breaks completely my workflow. Almost for every action I want to make I have to change my focus to the main monitor.

  • by vetinari on 4/24/20, 8:49 PM

    One more thing if you installed on ZFS:

    /var/snap is a subvolume. Purging snapd wants to remove the /var/snap directory, but it being mounted subvolume, it will fail. Purging snapd will therefore also fail.

    Destroy (-r) the /var/snap subvolume before apt purge snapd.

    Similarly, if using flatpak, create a new subvolume for /var/lib/flatpak before installing the first one. You don't need to snapshot your flatpaks together with the /.

  • by cies on 4/24/20, 9:37 PM

    To ensure snap will not be installed again see the apt config here:

    https://github.com/cies/kubuntu-setup#remove-snap

    This is needed because an every growing number op packages is "dependant" on it.

    Here I show how to install Chromium as a DEB package from Debian (on a buntu):

    https://github.com/cies/kubuntu-setup/tree/master/chromium

  • by troyready on 4/24/20, 10:07 PM

    One of the very annoying consequences of the Chromium move to snap on 20.04 is that it will silently fail to launch most external links (e.g. Slack, Zoom).

    A workound is posted at https://bugs.launchpad.net/snapd/+bug/1776873/comments/29 (simple patch & recompile). May be worth making a PPA for the fixed snapd if we can't get the Canonical dev team to fix the core issue.

  • by usr1106 on 4/25/20, 4:30 AM

    Most of our family PCs run Xubuntu LTS. Because they are low end / 10+ year old machines I always uninstall unnecessary stuff like snap. Have not seen a single case where I would have regretted this.

    I have been using Xubuntu 20.04 for several weeks and it has worked well. Because that's a high end laptop I have not bothered to uninstall snap yet, although that has been on my mind.

    I am surprised that the article writes there are snaps installed by default. Checking in Xubuntu 20.04 that's luckily not the case

       $ snap list
       No snaps are installed yet. Try 'snap install hello-world'.
    
    So the only somewhat worrying news is that chromium is gone.

       $ apt show chromium-browser
       Package: chromium-browser
       Version: 80.0.3987.163-0ubuntu1
       ...
       Pre-Depends: debconf, snapd
       ...
       Description: Transitional package - chromium-browser -> chromium snap
        This is a transitional dummy package. It can safely be removed.
        .
        chromium-browser is now replaced by the chromium snap.
    
    Not that I would use Chromium more than 3 times a year. But occasionally some web site is broken on Firefox. And if it is important like a flight check-in I start chromium. But flying is not a valid use case in Europe at the moment so lets see how long I it takes until I note the lack of chromium again.
  • by djhaskin987 on 4/24/20, 9:01 PM

    I installed keepassxc using a snap, but because it was in a snap browser integration didn't work with my browser because of the snap isolation, rendering it useless. Also it's kind of weird that hey Damon has to run just so that I can install snaps and one Daemon per snap, too. I'm pretty sure I don't like that.
  • by benjaminjackman on 4/24/20, 9:18 PM

    So I've used ubuntu (Xubuntu, xfce) for quite a while and would rather not deal with this, are there any distros that aim to be ubuntu but without snap?

    Because hearing things like `sudo apt install chromium` actually aliases to using snap is disconcerting to say the least if true.

  • by musicale on 4/24/20, 9:55 PM

    > I lean more toward Flatpak as it is more performant

    What is "performant" supposed to mean here?

    Is Flatpak faster than Snap? more compact? simpler? more reliable/secure? easier to use? more efficient in terms of cpu/memory/communication/power/etc.? all of the above?

  • by lemagedurage on 4/24/20, 9:01 PM

    It's a shame that chromium's apt package uses snap now. Startup time increased from ~0.2 to 5-10 seconds. Using Brave fixes this.
  • by emersion on 4/24/20, 9:01 PM

    It seems like on recent Ubuntu installations some packages are provided by snaps (ie. "apt install XXX" will install a snap). I'd be interested in disabling this behaviour, if anyone knows.
  • by antpls on 4/25/20, 7:32 AM

    I installed Snap on Debian 10 stable to install Firefox and Chromium as snaps. It allows me to get the latest security updates for these 2 software without entering into dependency hell with the OS. Beside the slow startups, which is not really an issue with those apps because I keep them open all the time, it worked flawlessly so far for me.

    My only con is that the defaults update all snaps like every day, and I really would like to have better control on that, because I'm always on mobile data.

  • by schmichael on 4/24/20, 9:26 PM

    Performance aside I was very disturbed to learn snap packages have no namespacing and no useful mandatory authorship metadata: https://forum.snapcraft.io/t/lack-of-package-provenance-is-a...

    tl;dr -> HashiCorp's various tools exist as snaps but none are published by HashiCorp. All are out of date. Some have incorrect metadata. Few provide any clue as to who or where the upstream is. There's usually not even a way to contact the snap author to submit patches or ask for an upstream link. eg https://snapcraft.io/nomad

  • by zimbatm on 4/24/20, 9:57 PM

    Consider any other operating systems out there for a moment. A new upgrade comes along that contains unwanted features. How often is it possible to revert that by uninstalling a few packages?

    There is a level of care here which I think is great. Some engineer somewhere made sure that the system would still work without snaps. This is a very Debian attitude which Ubuntu inherits from and which I would like to celebrate for a bit :-)

  • by smkellat on 4/24/20, 9:39 PM

    In looking at some of the other entries about 20.04 on Mr. Custer’s site I’m wondering if it would’ve been simpler to just start with mini.iso to make an actual barebones installation and then install only what is actually desired. If you truly want a lean install then building your own custom mix is possible in Ubuntu and a relatively blank slate is available.
  • by lainga on 4/24/20, 8:47 PM

    Does Canonical have any 'push' motive for reducing dependence on apt? Or do they really just like snaps?
  • by ThrowawayR2 on 4/24/20, 8:50 PM

    Interesting but it raises the question of what the effects of removing those snap packages are? I note that he doesn't mention installing anything to replace them, so it's probably not serious but still...
  • by oedmarap on 4/25/20, 2:11 AM

    I recently switched from Ubuntu (before 20.04's release) to Clear Linux which has Flatpak integrated by default.

    Along with the native package "bundles" (e.g. dev-tools, ruby-basic, containers-virt, etc.) that include built-in dependencies, Flatpak/FlatHub apps seem to work better than Snap/Snapcraft in my experience.

  • by red_admiral on 4/25/20, 9:32 AM

    I really don't get what market ubuntu is going for here.

    People like me who would like a system that works their way, even if it's not the same way as the distribution maintainers - nope. Believe it or not, I don't want my desktop to be full of animations, I want updates to happen on my schedule, and I care about having the active title bar a different colour to the rest.

    People who believe in Free As In Freedom - it's still technically free, but for all practical purposes it might as well not be if you have to recompile a core package for things like using a non-standard home directory path. This is one of many things where I sigh and go Freedom wasnt meant to be like this.

    The average non-techy user - uses windows anyway, and has access to a much larger software ecosystem as a result.

  • by pmontra on 4/24/20, 9:03 PM

    If gnome-3-34-1804 and gtk-common-themes are a snap, what happens when we remove them? I expect to be able to install them using apt but I went to https://launchpad.net/ubuntu/focal/ and I couldn't find them. So "a snap-free Ubuntu" seems to be a really a different kind of Ubuntu. (Unless there are also other versions of Gnome in 20.04.)
  • by ilaksh on 4/24/20, 9:58 PM

    The issue I had with snap was my server was going down. I thought it had run out of disk space like the last few times, but it seemed to be out of memory. Then I looked in htop and something related to snap or lxc was using most of the RAM. I think this is Ubuntu 18. Don't remember what I installed that used snap. But I had to remove snap to prevent my server from running out of memory periodically making my program crash.
  • by KoenDG on 4/25/20, 12:19 AM

    I remember this happening: https://forum.snapcraft.io/t/docker-snap-18-09-9-error/14171...

    Not fun to think that could have happened on a production env if people didn't disable snap.

  • by simosx on 4/25/20, 1:21 AM

    Canonical distributes LXD as a snap package.

    That does not forbid others to package LXD independently. Debian has been close to packaging LXD at https://wiki.debian.org/LXD It is a matter of picking up interest to complete the work.

  • by ezoe on 4/25/20, 8:09 AM

    The only downside of disabling snap in Ubuntu is the Chromium. Since Ubuntu's official package of Chromium is using snap, disabling the snap means you don't get packaged Chromium from Canonical. You have to build it yourself or using other means of distribution, like using Debian apt package or proprietary Google Chrome.

    It's not much of a problem for me since I believe that keeping diversity of Web browser is necessary for the healthy Web ecosystem and I force myself to use Firefox. And I really hate Chromium force me to waste CPU time on some kind of test payload occasionaly, it use 100% of a core and there is no way to disable it.

    I'm fine with restricting myself to use Firefox since I'm not a Web frontend developer so I don't need to test Chromium behaviours myself. But others may not.

  • by fapjacks on 4/24/20, 10:54 PM

    And now, in a sort of hilarious turn of events, the latest pulseaudio update wants to install snapd (recommended by pulseaudio's new libsnapd-glib1 dependency). And of course, when someone asked about it, they just got a quiet WONTFIX.
  • by pnako on 4/24/20, 11:17 PM

    Just install Debian instead of disabling all the stupid stuff from Canonical.
  • by stbtrax on 4/24/20, 10:48 PM

    What problem were snaps trying to solve?
  • by lokedhs on 4/25/20, 3:46 PM

    To me is seems as though Snap is playing a similar part as Unity did in Ubuntu. It's Canonical suffering from NIH.

    Flatpak exists and works. The application I'm working on is distributed on Flathub, and I don't have the time nor the interest to learn yet another packaging system.

    Ubuntu would do well trying to not just lead (which they do in some aspects, I'm sure) but also try to follow when it's more appropriate. The push towards Unity and now Snap just causes more fragmentation in the Linux community.

  • by SkyMarshal on 4/26/20, 8:51 AM

    Does anyone else use update-alternatives to install and maintain software? Takes a little setup work, mainly in scripting the soft links for binaries, but once done it’s a pretty clean way of managing software installations.

    http://manpages.ubuntu.com/manpages/trusty/man8/update-alter...

  • by aloknnikhil on 4/25/20, 4:12 AM

    Thanks for this. I followed the steps and it failed to unmount the current "core" mount for snapd because the target was busy. What helped me was to unmount it lazily by running 'sudo umount -l /snap/core/xxxx' and then purging the package. That helped things move along. Just in case someone runs into this issue.
  • by LockAndLol on 4/25/20, 9:03 AM

    Say bye bye to Chromium on 20.04 from the default repos

    https://www.reddit.com/r/linuxquestions/comments/g7cv6k/debs...

    The deb tries to install the Chromium snap package ;)

  • by Tijdreiziger on 4/24/20, 10:32 PM

    So can anyone actually explain what Snaps and Flatpaks are? Why are they good/bad? And how do they compare to each other?
  • by usr1106 on 4/25/20, 5:31 AM

    I always uninstall snapd, too.

    Inspired by this post I checked what is actually offered as a snap.

    This one surprised me: https://snapcraft.io/aws-kernel

    Who can explain me how I would use a kernel running as a snap?

    Well, last updated 2017, so I don't think I want to try that one.

  • by joshuaellinger on 4/25/20, 5:20 AM

    Very timely.

    Just tried to install 20.04 on LVM. It gets in to a completely broken state if you misconfigure the network due to an error in an exception handler in an Python error handling view in the UI. Doesn't exactly inspire confidence.

  • by coderesearch on 4/25/20, 10:15 AM

    Two questions:

    a) is it possible to use Chromium without snaps?

    b) Can anybody please describe the general experience with Centos for a media production machine - needs to run NVIDIA GPU support, Ardour, low latency jackd and Davinci Resolve on XFCE.

  • by nikisweeting on 4/24/20, 9:11 PM

    Semi-related: does anyone know how to install microk8s via apt without snap?
  • by favadi on 4/25/20, 5:36 AM

    I don't understand the need to remove it, if you don't like snap, just ignore it and don't install anything from it. There is no harm keeping them instlaled, right?
  • by arodyginc on 4/24/20, 10:15 PM

    You can also get snap-free Kubuntu (with a great Plazma desktop)
  • by dancemethis on 4/25/20, 1:36 PM

    The two snaps I had to interact with so far, dotnetCore and microk8s are ridiculously bad. Why they have so many stupid quirks and nonlogical interfaces are way beyond me.
  • by ressetera on 4/24/20, 9:48 PM

    Snaps are great for auto updating software, especially the ones from JetBrains.

    I think most users will be fine. Those of us who need more fine grained control, can have it.

  • by sgnnseven on 4/25/20, 2:55 AM

    Take note though that AppArmor breaks when removing the snapd package using this method - at least that was the case for me about a week ago :/
  • by notokay on 4/24/20, 9:38 PM

    Nice and helpful guide.

    In this month only I had to give up using firefox because uglyBar and ubuntu because of snaps.

    There won't be anywhere to run soon.

  • by Pmop on 4/24/20, 9:35 PM

    Funny thing: snapd is suggested for installation when executing

      sudo apt install gnome-software-plugin-flatpak
  • by grizzles on 4/25/20, 2:15 AM

    Snaps < Flatpak

    ufw < firewall-config

    ===============

    I like & prefer Ubuntu. But where else is Fedora/CentOS/other distros ahead of Ubuntu?

  • by bfrog on 4/25/20, 2:40 PM

    Snap is honestly driving me away from Ubuntu. Managed systems are less manageable with snap involved.
  • by zamadatix on 4/25/20, 1:14 AM

    What happens if you just sudo apt purge snapd without the rest?
  • by ausjke on 4/25/20, 3:51 AM

    been a long time Ubuntu LTS user, reading from the discussion here, I'm seriously thinking about moving back to Debian _fully_, anybody is doing it similarly?
  • by coleifer on 4/24/20, 9:36 PM

    Canonical always has tried to differentiate themselves, and they just can't execute. Remember Unity, Mir, Juju, upstart and all the other failed shit they've come out with? Snap is just more of the same. I don't want to run that garbage on my desktop. I don't need more daemons and forced auto-updates and all the baggage.

    I strongly recommend anyone similarly frustrated to check out debian, which is a fantastic distro. Thanks to Kevin for posting this, but if you're using Ubuntu and disabling snap, you're fighting against the current and I have to imagine it's going to be increasingly difficult with subsequent releases.

  • by aledthemathguy on 4/25/20, 9:15 AM

    Excuse my question, but why even Ubuntu? Isn't something like Manjaro better?