Ceci est une ancienne révision du document !
In FCM#181, Adam Hunt says in his Review that we have to live with Firefox on snap on Ubuntu 22.04, unless you want to compile from source “or something equally esoteric.”
Two big problems with snap have been its slow startup on a freshly-booted computer for older distributions, and sometimes overzealous security restrictions. Now, it seems to be even slower on Ubuntu 22.04, to the point where starting up Firefox takes outrageously long after a reboot, even on a reasonably modern computer!
(Edit: Since writing this article, Canonical has been actively working on reducing this time, with good results.)
Along with snap’s proprietary nature, these problems have, unfortunately, led to a lot of “hate” towards Ubuntu on some forums. This is a pity, because hate is a powerful and unnecessary emotion.
Anyway, the point here is to discuss an alternative that doesn’t involve hard work such as compiling from source.
So, here’s a great alternative to think about…
Flatpak
Like snap, flatpak supplies packages with their dependencies and extra security. As a bonus, you can use Flatseal to tweak each package’s security. Plus, some packages are available on flatpak but not snap, e.g. Avidemux, Meld (but also vice-versa, e.g. Adobe Acrobat Reader). I’ve also found that flatpak tends to have more up-to-date packages than snap, e.g. GIMP, Krita. Of course, both snap and flatpak generally hold more up-to-date versions than the Ubuntu repositories, which quickly fall behind.
On Ubuntu 20.04, and now Ubuntu 22.04, I installed flatpak alongside snap. My software centre thus offers a choice of deb, snap, or flatpak for each package (where available), and flatpak is included in the automatic updates. Naturally, I replaced the snap version of Firefox with the flatpak version.
Some people dislike snap so much that they uninstall the entire snap system. While you can do this, I don’t recommend it on Ubuntu, because Canonical depends on it to supply some features, e.g. Livepatch.
What’s the point?
Comparing snap and flatpak: • Snap and flatpak share the advantages of higher security and full dependencies. • Both systems share the disadvantage of needing more disk space, and sometimes not quite fitting in with the desktop theme. • Snaps are slow, sometimes ridiculously so, when first loading after starting or restarting the computer. • Security can be overzealous, but you can tweak flatpak security with Flatseal.
Install flatpak
If you’re interested, here are the steps to install flatpak and Flatseal.
Install Flatpak and its Gnome connection. The dependencies include the GUI app Gnome Software, which will replace Ubuntu Software.
sudo apt install gnome-software-plugin-snap gnome-software-plugin-flatpak
Remove the now-redundant Ubuntu Software app.
sudo snap remove –purge snap-store
From your menu, start Gnome Software, which looks similar to Ubuntu Software. Check that your updates are set to automatic, unless you want to manually control them: Menu (the hamburger menu at the top-right) > Update Preferences. But don’t install or uninstall apps yet.
Restart your computer to allow flatpak to start properly. This is important; don’t skip this step.
Connect flatpak to the central repository Flathub.
flatpak remote-add –if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
Install Flatseal. Because this is the first time using Flathub, it might take a minute or so for flatpak to initialise it; this won’t happen again.
flatpak install com.github.tchx84.Flatseal
When you use the terminal, you’ll be asked for confirmation. Just enter “y”.
That’s it! Flatpak is installed and available. To learn more about using flatpak from the terminal, enter man flatpak into the terminal. Or, ignore the terminal, and install and uninstall packages from Gnome Software; note the Source option at the top-right when installing an app.
Replace snap Firefox with flatpak
You can replace the snap version of Firefox with the flatpak version. Warning: You will lose your Firefox settings, unless you have signed in and synchronised them.
Remove the snap version of Firefox.
sudo snap remove –purge firefox
Install the flatpak version of Firefox.
flatpak install org.mozilla.firefox
If you prefer to do this from the GUI (using Gnome Software) instead of the terminal, be aware that it lists two different Firefox entries, one each for snap and flatpak.
Remove snap (only if you insist)
If you truly want to get rid of the snap system itself, here’s how. I don’t recommend this; do it at your own risk!
Purge the snap system.
sudo apt remove –purge snapd
Optional: Delete your snap directory.
rm –recursive ~/snap
Restart your computer.
Summary
If you follow the steps in this article to add flatpak, you will have a wider choice of software, sometimes more up-to-date, and with greater flexibility.