chromium browser / without ubuntu snap / linux mint

chromium browser / without ubuntu snap / linux mint

  • Written by
    Walter Doekes
  • Published on

In 2019, Clement "Clem" Lefebvre of Linux Mint, wrote these profetic words: “As long as snap is a solution to a problem, it’s great. Just like Flatpak, it can solve some of the real issues we have with frozen package bases. It can provide us with software we couldn’t otherwise run as packages. When it starts replacing packages for no good reason though, when it starts harming our interaction with upstream projects and software vendors and reducing our choice, it becomes a threat."

For me, this point appears to have arrived on Ubuntu. The chromium-browser has been moved to a snap package in Ubuntu 20.04. Firefox also moved to snap in Ubuntu 22.04. Is this a problem?

Yes! It is.

Since the (silent) replacement of these packages to snap packages, I've ran into:

  • Font issues that are caused by the snap confinement, but are not common enough to get properly fixed.
  • A grave bug with drag and drop, that was broken in all available snaps: I had to export a snap from another machine that still had a non-broken chromium-browser. Getting an older (working) version from the snapcraft store was not supported. Instead I was told I should've made backups... of an application. (Exploding head emoji here.)
  • Forced automatic updates (with a couple of issues), that force me to restart my browser.
  • There are minor annoyances, like extra memory/disk usage, extra items in df and mount listings.
  • Failed file uploads for no good reason (non-$USER-owned files in my homedir are blacklisted) and with no visible cause. The snapcraft developers consider such use "exotic". I mean, who in their right mind has tcpdump-owned files in their homedir? /s

I think that last one, and especially the mindset of the developers — “we force people to adapt to far worse workarounds than running chown on files for much more common usecases” — is the straw that broke the camel's back.

Moving to Mint Packages

Ubuntu has served me great both as desktop and server system well over twelve years. Canonical did not always get everything right in the first try (upstart anyone?), but generally stuff has worked remarkably well. For that I am grateful.

So, instead of flat out ditching Ubuntu, I shall first try if we can just borrow packages from Linux Mint. I'm running Ubuntu/Jammy 22.04 off of which Linux Mint Vanessa 21 is based. (For Focal 20.04, there is Mint 20.3 Una.)

Setting it up (as root):

echo "deb [signed-by=/etc/apt/keyrings/linuxmint.com.gpg]\
 http://packages.linuxmint.com vanessa upstream" \
  >/etc/apt/sources.list.d/linuxmint.list
mkdir -p /etc/apt/keyrings
tmp=$(mktemp -d) &&
  GNUPGHOME=$tmp gpg --keyserver keyserver.ubuntu.com \
    --recv-keys 0xA6616109451BBBF2 &&
  GNUPGHOME=$tmp gpg --export A6616109451BBBF2 \
    >/etc/apt/keyrings/linuxmint.com.gpg &&
  rm -rf $tmp
cat >/etc/apt/preferences.d/linuxmint-against-snapcraft.pref <<EOF
Package: *
Pin: origin packages.linuxmint.com
Pin-Priority: -1

# Pinning does not need to go above 1000 because we do not need to
# downgrade. Ubuntu does not ship with a chromium package.
Package: chromium
Pin: origin packages.linuxmint.com
Pin-Priority: 600

# Firefox depends on ubuntu-system-adjustments, but you can install
# https://github.com/wdoekes/nosnap-deb/releases/download/v0.1/nosnap_0.1_all.deb
# as replacement.
Package: firefox
Pin: origin packages.linuxmint.com
Pin-Priority: 1000

# Thunderbird is still shipped as a real OS-component, so this is not needed yet.
#Package: thunderbird
EOF
apt-get update && apt-get install chromium

We'll see how this pans out and if we can purge snapd with fire.

$ snap list chromium
Name      Version        Rev
chromium  104.0.5112.79  2051
$ dpkg -l | grep chromium
ii  chromium  104.0.5112.101~linuxmint1+vanessa

So far, so good...

Using packages from other Distros?

Is it a good idea to use a package from Linux Mint?

If you're aware of the pitfalls, and its dependencies don't diverge from what you already have (Mint is based on Ubuntu), you should be fine.

Additionally, I can recommend apt-find-foreign, a tool that lists the origin of packages on your Debian derivative system. A run might look like this:

$ apt-find-foreign
Lists with corresponding package counts:
  3224  http://archive.ubuntu.com/ubuntu
  4     http://ddebs.ubuntu.com
  1     http://packages.linuxmint.com

Lists with very few packages (or with remarks):
  http://ddebs.ubuntu.com
    - libmount1-dbgsym
    - mount-dbgsym
    - openssh-client-dbgsym
    - util-linux-dbgsym
  http://packages.linuxmint.com
    - chromium

It's good practice to run this after doing package upgrades to confirm that you don't have unexpected foreign (or old) packages on your system.

Profile gone?

Yes. The new Mint Chromium does not read the profile of your Snap Chromium. If you want to keep bookmarks, current sessions, etc., you'll need to do some migrating.

This should be sufficient before your first run:

rm -rf ~/.config/chromium
cp -a ~/snap/chromium/common/chromium ~/.config/chromium

Once you're happy, you can remove the ~/snap/ stuff.

Also on Focal?

For Ubuntu/Focal you need to use una instead of vanessa in the /etc/apt/sources.list.d/linuxmint.list file.

As of this writing, there is a font/color issue with background tab text: inactive tabs have an icon but no label text. This can be fixed by going into Settings, Appearance and selecting the Classic theme, instead of GTK+.

Google as search engine?

Go to Chromium settings, Search engine, Manage, Add a new “site search”:

Search engine: Google
Shortcut:      g
URLs:          https://www.google.com/search?q=%s
(or)
URLs:          {google:baseURL}search?q=%s&{google:RLZ}{google:originalQueryForSuggestion}{google:assistedQueryStats}{google:searchboxStats}{google:searchFieldtrialParameter}{google:iOSSearchLanguage}{google:prefetchSource}{google:searchClient}{google:sourceId}{google:contextualSearchVersion}ie={inputEncoding}

And then click Make default from its hamburger menu.

Firefox?

The same steps as above apply. But you'll need a ubuntu-system-adjustments >= 2021.12.16 package to satisfy the dependencies of the Firefox package. You can download and install nosnap_0.1_all.deb that provides such a dependency:

wget https://github.com/wdoekes/nosnap-deb/releases/download/v0.1/nosnap_0.1_all.deb

(sha256sum 1b634ca7 a66814a0 40907c6b a726fd5a a63e1687 5a24a8ce 6b7b28d8 0d0e1e5a nosnap_0.1_all.deb)

dpkg -i nosnap_0.1_all.deb
apt-get install firefox
rm -rf ~/.mozilla
cp -a ~/snap/firefox/common/.mozilla ~/.mozilla

At this point, you may need to do some magic, because over here, I had to fiddle with profiles.ini like this:

--- .mozilla/firefox/installs.ini
+++ .mozilla/firefox/installs.ini
@@ -1,3 +1,4 @@
 [4C36D121DA48BA8E]
 Default=fvorzk4r.default-1644166646276
+Locked=1

--- .mozilla/firefox/profiles.ini
+++ .mozilla/firefox/profiles.ini
@@ -1,3 +1,7 @@
+[Install4C36D121DA48BA8E]
+Default=fvorzk4r.default-1644166646276
+Locked=1
+
 [Profile0]
 Name=default
 IsRelative=1

Doing the above changes fixed so the right profile was loaded when starting Firefox.

Purging snapd?

I'll leave the purging — or at least the disabling from auto-starting while you're not using it — of snapd to another post.

Final words

I am not against Snap (or AppImage or Flatpak). They have their uses for applications that not everyone uses all the time. I've certainly used it for the Arduino IDE — until the strict confinement disallowed me from setting up the Micro:bit environment — or the Drawio app — until I ran into a version that crashed when trying to save, because of bad library dependencies inside the snap. But for standard packages that can be considered part of the OS — I'm talking about web browsers — using snap is a bridge too far. Especially if it secretly introduces confinement that you are not made aware of.


Back to overview Older post: falco helm upgrade / labelselector field immutable