Linux on a smartphone with PostmarketOS

Open Call

Article from Issue 254/2022

The mobile Linux distribution PostmarketOS is a fork of Alpine Linux that supports around a dozen user interfaces.

Mobile Linux operating systems have experienced an enormous upswing in recent years due to the development of Linux smartphones like the PinePhone and the Librem 5. Around two dozen Linux smartphones exist today, and you can find the 15 most important operating systems on the ISO of a multi-distro demo known as Megi's multi-boot image [1]. Fragmentation in the mobile Linux operating system niche is high, but there is also some cross-fertilization in the scene.

The incentive is the desire to counter the duopoly of Android and iOS with something that open source enthusiasts can use without hesitation. The goal is also about sustainability. Frugal users believe that mobile devices need to be supported for ten or more years, instead of dropping out of the update process after two years, as is usually the case with Android, and ending up as hazardous waste. Mainlining [2] is an important keyword here – the term refers to the process of replacing the supplied kernel with a kernel that corresponds as closely as possible to the mainline kernel at

At the center of this development is the open source project PostmarketOS (PMOS) [3], founded in 2017 as a fork of the minimalist Alpine Linux distribution [4]. PMOS supports several user interfaces (Figure 1), including KDE Plasma Mobile, Unity 8 (the UI now known as Lomiri), Purism's GTK-based Wayland Phosh interface developed for Librem 5, the tiling compositor Sway, the Suckless-based Sxmo, Gnome, Mate, and Xfce4. Devices like the PinePhone or the Librem 5 run a mainline kernel out of the box, but the intent is for all Android devices with PMOS to operate with a mainline kernel in the long run, if possible.

Figure 1: Plasma Mobile (left) is one of the oldest mobile environments for Linux smartphones. The Phosh interface (right) was developed by Purism for the Librem 5.

PMOS is best known for supporting the PinePhone and Librem 5 phones, but the PMOS community supports 14 devices at various stages of usability. These devices include the Nokia N900, Wileyfox Swift, OnePlus 6, BQ Aquaris X5, and Pine64's PineTab tablet. In addition, around 300 devices are capable of booting from a PMOS image; around 90 of them already have mainline support. As soon as maintainers can be found for these devices, they will be promoted to the rank of community projects. The developers maintain a list of all supported devices in the project's wiki [5].

Recently, PMOS developers have also been working on making the distribution available for smartwatches. To achieve this smartwatch support, they are integrating the user interface of AsteroidOS [6], which was developed specifically for smartwatches and is based on Qt 5 and QML. Here, too, the main aim is to take the fight to proprietary devices for the wrist, which often have even shorter-lived software support than smartphones, by offering an operating system with long-term support. AsteroidOS currently supports a total of 16 smartwatches [7].

Quick Install

For less tech-savvy contemporaries, installing an Android ROM like LineageOS on an Android cell phone is still an error-prone endeavor, even after years of development. The new swarm of Linux smartphones simplifies this process considerably. First, you transfer the image to an SD card with the Linux dd command or a tool like USBImager. After removing the back of the PinePhone, you insert the card into the slot above the SIM card and boot from there. This is more or less the same as testing the Live version of a distribution for the desktop from a USB stick. The aforementioned multi-boot ISO, which combines 15 distributions for testing on an SD card, is a good option.

Once you have stored the multi-boot ISO on the SD card and inserted it into the PinePhone or other supported device, you will see a selection menu after startup that lists the available user interfaces, including five PMOS variants with Plasma Desktop, Plasma Mobile, Phosh, Gnome, and Sxmo (Figure 2). You can navigate through the options with the volume rocker and invoke the selected interface with the Start button. At the very top of the selection, you will possibly find a previously installed distribution in the fixed internal eMMC memory. At the bottom, you can activate a private mode that disables wireless support, the camera, and the microphone for the test.

Figure 2: Megi's multi-boot ISO is a useful option for getting to know PostmarketOS, with four different environments in addition to distributions like Mobian, Arch, Fedora, and Sailfish.

This ISO offers the fastest starting point for getting to know PMOS in its entirety on the PinePhone or other supported smartphone. If you prefer to test the different variants individually or have already decided on an interface, you can find detailed instructions and reports on the PMOS wiki describing what already works with the interface and what will take some time [8].

The distributions gathered on the multi-boot ISO are meant for testing, not for installation. The images of the individual distributions offer some advantages. One benefit is that you can create a more up-to-date image of your desired interface, because you design the image yourself using pmbootstrap [9], which is part of PMOS. And this method automatically expands the root filesystem to the entire available space on the SD card. In addition, you can store a public key for SSH directly on the system if it is on the Linux PC on which pmbootstrap is running.

If you are experimenting with PMOS, you need to be aware that the project is entering uncharted territory and that the distribution is still under development; a first stable version was released in early July 2021. However, in combination with the inexpensive PinePhone, it makes for an ideal experimental field to familiarize yourself with the new Linux phone niche. If you keep that in mind, there is nothing standing in the way of an installation on the PinePhone's internal eMMC memory card. You can install directly via pmbootstrap or transfer PMOS from a booted SD card to the eMMC with Jumpdrive [10].


PinePhone's development stagnated for quite some time with the suspend feature, or rather, the inability to wake up from it early enough when a call comes in. The problem has now been fixed, so you can use hibernation mode and answer calls on the first ring. This also ensures an acceptable runtime.

In addition, the camera was an unusable component for a long time, since it lacked an app capable of taking pictures. PMOS developer Martijn Braam, who is enthusiastic about photography, remedied this with his Megapixels app. Developed for PMOS, it now enjoys widespread use on other mobile distributions. Braam described the journey in a series of four blog entries [11]. He also wrote an implementation of Gnome Tweaks for PMOS, which goes by the name of postmarketOS Tweaks [12].

Listing 1 summarizes the commands you use to put PMOS on an SD card, which you then boot on the PinePhone. The PIN you are prompted for at startup time and the passwords for user and root are 1111 for Megi's multi-boot ISO. For a user-designed image, you can set these details during the bootstrap process.

Listing 1

Installing PMOS on an SD Card

### Install Python-Pip3 on the PC
### Debian:
$ sudo apt install git python3-pip
### Fedora:
$ sudo dnf install git python3-pip
### Install Pmbootstrap:
$ pip3 install --user pmbootstrap
### Create an environment:
$ pmbootstrap init
### Release Channel: stable or edge
### Choose a vendor: pine64
### Codename: pinephone
### Define timezone, name etc.
### Copy SSH key if needed
### Start installation. Before doing so run
### fdisk -l to check if mmcblk0
### is the right device
$ pmbootstrap install --sdcard=/dev/mmcblk0

You can install additional packages using the Alpine package manager, apk. For example, to install Braam's photo app, use sudo apk add megapixels. Alpine does not use systemd, but rather RC as an init program. Enable SSH by typing sudo rc-service sshd start. To enable SSH at every reboot, run the sudo rc-update add sshd command. As usual, you will find the IP address of the PinePhone needed for SSH with the ifconfig or ip a commands.

We found the Librem 5 interface Phosh to be the most likely to show PMOS in its best light. The version from Megi's ISO shipped with kernel 5.13-rc4. In addition to the telephony app, the chat module Chatty, and the contacts app, and the Firefox browser, you'll find some familiar Gnome programs, such as Files, Software, Settings, Terminal, and Tweaks (Figure 3). A Welcome menu explains the various gestures.

Figure 3: As a fork of Alpine Linux, PMOS uses Alpine's package manager apk (left). A mobile-ready version of the Gnome Files app is used as a file manager (center). Not all mobile distributions have adapted Firefox as well as PMOS with Phosh (right).

We post-installed Gnome Screenshot, Gnome Maps, and htop in our lab, and all of them work. However, due to the PinePhone's low-powered hardware, things are quite slow. And not all apps fit the form factor perfectly as of yet, which means that you have to rotate the device through 90 degrees to access the buttons for some actions.

Conclusions and Outlook

All told, PostmarketOS's current features will not be enough for many wanting to use the PinePhone as their sole daily companion. This hesitancy is partly due to the limited hardware and partly due to the early stage of development for PMOS itself.

Many users are longing for a Linux PC in their pockets, and the fact that it is taking so long is a disappointment for many enthusiasts. But you have to remember that the community is just now laying the foundations for – hopefully sustainable – long-term development.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • The PinePhone Pre-Order has Arrived

    Anyone looking to finally get their hands on an early release of the PinePhone can do so as of November 15.

  • PinePhone Now Offers a Convergence Package

    The makers of the Linux PinePhone are now offering a model that makes desktop/mobile convergence a reality.

  • NEWS

    In the news: LibreOffice 7 Now Available; Microsoft Brings Procmon to Linux; New KDE Slimbook Available; PinePhone Now Offers a Convergence Package; Flutter Is Coming to Linux; and SUSE Rolls Out Service Pack 2 for SLE

  • FOSSPicks

    This month Graham looks at Bespoke, Waydroid, OpenShot, pedalboard, Onivim 2, Mr. Rescue, and more!

  • OpenMandriva Lx 4.2 has Arrived

    The latest stable version of OpenMandriva has been released and offers the newest KDE desktop and ARM support.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More