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:
- Are not already installed on the base pmOS installation. These will not form part of the test.
- 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 Installation||Flatpak Installation|
|Installation Command:||Installation Command:|
|sudo apk upgrade -a|
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.
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.