Skip to content
Menu
linux phone guides
  • postmarketOS
  • Flatpak
  • OnePlus 6
  • Moto G4 Play
  • Librem 5
  • Gaming
  • PineTime
linux phone guides

The Flatpak Controversy: Part 1 (Storage)

Posted on February 18, 2023March 18, 2023

This is the first of several articles I intend to publish on the use of Flatpaks on Linux mobile devices. Rather than dig too deep into a subject I cannot pretend to know inside and out, I conducted a number of tests that I believe illustrate the benefits and drawbacks of using Flatpaks on Linux phones.

This article involves a comparative test to determine whether using Flatpaks to install a near-complete set of mobile-friendly applications takes more storage space than if the same applications had been installed using the Alpine repository. For this test, I flashed a fresh copy of pmOS (v.22.12) onto a Moto G4 Play and installed a list of applications using Flatpaks, and then flashed the phone again and installing the same list of applications using the Alpine repository.

There are obvious drawbacks to this method of comparing storage requirements. Primarily, versions of software from Flathub may be newer or older than the versions in the Alpine repository. As such, the size of the applications may differ slightly and may add up to have an overall impact on the results. For the purposes of this test, however, I will presume that version differences have a negligible impact on the size of the applications.

This test will also help to prove, or disprove, the claim that Flatpaks have a greater storage requirement early on, when only a few Flatpaks have been installed. The claims goes on to state that overtime, as the number of Flatpaks on your device increases, the storage requirements tends to level off and become on par with the storage required from a traditional repository. This is because Flatpaks require large supporting libraries that are required in full but will ultimately be shared between multiple Flatpaks over time. Let’s see if that checks out.

I reviewed my list of top mobile applications and identified all those that:

  1. Are not already installed on the base pmOS installation. These will not form part of the test.
  2. Exist in both Flatpak (via Flathub) and the Alpine repository. This leaves out anything that only exists in one repository (ie. Fragments is only available as a Flatpak. Dino messenger is only available as an Alpine package.)

The list of applications is as follows:

Alpine InstallationFlatpak Installation
evinceorg.gnome.Evince
nautilusorg.gnome.Nautilus
gearyorg.gnome.Geary
image-rollcom.github.weclaw1.ImageRoll
gnome-mapsorg.gnome.Maps
pure-mapsio.github.rinigus.PureMaps
osmscout-serverio.github.rinigus.OSMScoutServer
gnome-weatherorg.gnome.Weather
epiphanyorg.gnome.Epiphany
gnome-sound-recorderorg.gnome.SoundRecorder
gnome-podcastsorg.gnome.Podcasts
amberolio.bassi.Amberol
mpvio.mpv.Mpv
foliatecom.github.johnfactotum.Foliate
gnome-authenticatorcom.belmoussaoui.Authenticator
newsflashcom.gitlab.newsflash
gnome-feedsorg.gabmus.gfeeds
gnome-shortwavede.haeckerfelix.Shortwave
file-rollerorg.gnome.FileRoller
Installation Command:Installation Command:
sudo apk upgrade -a

sudo apk add evince nautilus geary image-roll gnome-maps pure-maps osmscout-server gnome-weather epiphany gnome-sound-recorder gnome-podcasts amberol mpv foliate gnome-authenticator newsflash gnome-feeds gnome-shortwave file-roller
sudo apk add flatpak

sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

sudo flatpak install flathub org.gnome.Evince org.gnome.Nautilus org.gnome.Geary com.github.weclaw1.ImageRoll org.gnome.Maps io.github.rinigus.PureMaps io.github.rinigus.OSMScoutServer org.gnome.Weather org.gnome.Epiphany org.gnome.SoundRecorder org.gnome.Podcasts io.bassi.Amberol io.mpv.Mpv com.github.johnfactotum.Foliate com.belmoussaoui.Authenticator com.gitlab.newsflash org.gabmus.gfeeds de.haeckerfelix.Shortwave org.gnome.FileRoller

Below is a screenshot of the Moto G4 Play running a fresh installation of pmOS v22.12 with Phosh. The phone was fully upgraded before installing the software. I also installed GNOME Screenshot via sudo apk add gnome-screenshot.

Running df -h provides the following storage information based on a storage of 10GB. The fresh pmOS installation takes up 16% (1.6GB) of storage.

Installing the above 19 packages from the Alpine repository and running this command again indicates that the total storage used is now 22% (2.2GB). That’s an increase of about 600MB.

Flashing the phone again, running through the same steps, but installing Flatpaks instead indicates that the total storage used is now 83% (8.3GB).

That is a whopping increase of 61% or 6.1GB over the installation using the Alpine repository. Without going any further, and delving into Part 2 of The Flatpak Controversy, I think it’s appropriate to take a minute to ask ourselves if Flatpaks are a reasonable tool on Linux mobile today.

If I had an opinion that mattered, I would urge any group working on Linux mobile (ie. pmOS, Purism, Mobian, etc.) to ensure that their distribution maintains a healthy and mature package repository. I would stress the importance of not leaning heavily on Flatpaks if you want to demonstrate that your hardware is up to the challenge of replacing our Android phones and iPhones. I’m speaking mostly to Purism here but not exclusively. The Librem 5 has 32GB eMMC storage and an additional microSD card slot. That may sound like a lot, but with Flatpaks, it really isn’t.

Flatpaks may be ready for Linux phones, but Linux phones are not ready for Flatpaks.

©2023 linux phone guides | Powered by SuperbThemes & WordPress