Ubuntu 20.04 LTS uses Snap to distribute certain packages by default, including Chromium. This was a mistake and yields dysfunctional systems. Here’s how to fix it.

How

Remove all installed snaps:

for p in $(snap list | awk '{print $1}'); do
  sudo snap remove $p
done

Clean up the core package:

sudo systemctl stop snapd
for m in /snap/core/*; do
   sudo umount $m
done
sudo snap remove core
# If anything remains, the steps below will take care of it.

Deinstall snapd:

sudo apt autoremove --purge snapd

Remove leftover directories:

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

Block future installs:

sudo bash -c "cat > /etc/apt/preferences.d/no-snapd.pref" << EOL
Package: snapd
Pin: origin ""
Pin-Priority: -1
EOL

If desired, install Chromium using Debian packages or Chrome from Google’s own .debs.

Why

  • Stability: each snap’s upstream vendor can push updates any time they want; updates are mandatory and cannot be blocked. If a regression is introduced, it is not possible to hold back an upgrade or downgrade.
  • Security: each snap image contains all its dependencies. If a security vulnerability is present in a dependency it will remain until the upstream vendor pushes an update, even if the host system has an update already.
  • Cost: upgrades are mandatory and occur as soon as Internet connectivity is available. This incurs mandatory network costs. Snap images are large because they contain all their dependencies. This wastes storage even when storage is at a premium.
  • Performance: snap images are compressed and must be decompressed every time the program is loaded.
  • Compatibility: Snap programs cannot access or store files in directories mounted from secondary storage (secondary hard drive, network filesystem, etc.). Due to architectural restrictions in snapd it is not possible to migrate the data to a different filesystem and use a symlink. It prevents use of profile-sync-daemon.
  • Governance and misaligned incentives: the snap infrastructure is tied to a closed service (“Snap store”) run and controlled by Canonical. It’s not possible to set up additional software channels. Canonical can exert control and could be forced to deploy nefarious softwre to users residing under an authoritarian regime.
  • Filesystem: the snap directory is ~/snap in every home folder. It does not adhere to the filesystem standard (it should be hidden).

Ubuntu defaulting to snap packaging flies in the face of the open source movement and is a disgrace. I hope it will be removed in a later version.

Like this post? Share on: TwitterHacker NewsRedditLinkedInEmail

Comments

So what do you think? Did I miss something? Is any part unclear? Leave your comments below.


Published

Category

Programming

Stay in Touch