PostmarketOS is an operating system based on Alpine Linux which is designed to run on smartphones, tablets, and other mobile devices. It can at least boot on over 200 devices, and it supports a number of different user interfaces.
The PinePhone postmarketOS Community Edition is one of the first smartphones that actually ships with the operating system pre-installed, and it comes with a version of the OS featuring the Phosh user interface.
When you first boot the phone you’ll go through a short setup process and before you’re greeted with a pretty barebones operating system featuring a notification area, app drawer, and only a handful of applications. There’s a software center, but as of early October 2020 it’s mostly used to update packages that are already installed on your device including system files, the Firefox web browser, and a few other apps.
Installing third-party applications is pretty easy… but it’s also pretty geeky. You’ll need to use a command line.
PostmarketOS uses the Alpine Linux Package Manager, which means that you can install, delete, update, repair, upgrade, or search for apps using apk commands. Note that this is not the same thing as APK files for Android devices. You cannot install Android apps on a device running postmarketOS unless you first install a tool like Anbox that allows an Android system to run within a Linux environment.
In order to install an application, you would open a terminal window and type:
sudo apk add <package name>
For example, if you want to install the Megapixels camera app (which you probably do if you’re using a PinePhone, because it’s by far the best camera app available), you would type:
sudo apk add megapixels
Note that the first time you do this after opening a terminal window, you’ll be asked to enter your password, which should be the same as the PIN code you use to unlock your device.
Then the phone will automatically find, download, and install the latest stable version of the application from the appropriate repository. You can either launch it from the terminal by just typing the word “megapixels” and hitting enter, or find it in the app drawer.
Note that you may not get all the features included in the most recent build of the application unless you also jump through some additional hoops like updating your Linux kernel, but that’s beyond the scope of this article.
Want to remove an application? Just replace the word “add” in the command above with “del,” so the new line looks like this:
sudo apk del megapixels
This should work with many other packages available for Alpine Linux. The phone doesn’t have a pre-installed file manager, for example, so I installed PCManFM by typing:
sudo apk add pcmanfm
I wanted an image viewer, so I added EyeOfGnome with:
sudo apk add eog
Actually, I spent a bit of time installing and uninstalling various apps before deciding that these were some of the most usable on a smartphone-sized device. Some other file browsers and image viewers were clearly meant for computers with larger screens.
If you have any better suggestions for file managers, image viewers, or other GNU/Linux applications that run well on smartphones, let me know.
In the video above, I connected a USB dongle so I could use a mouse and keyboard to quickly type commands into a terminal window and more quickly navigate between applications. But you could also use the on-screen keyboard or establish a wireless connection to your phone using SSH to install or remove apps from a PC.
command not found…what am I doing wrong? im using the phone terminal sudo apk add megapixels or del both don’t seem to work…
I’m facing the same issue “apk: command not found”.
also, “snap: command not found”.
I can’t find any documentation on how to get it running.
Are you sure your PinePhone is running postmarketOS and not a different operating system? Manjaro, for examples, uses a different package manager.
Since postmarketOS is based on Alpine Linux, much of the documentation for Alpine applies. Here’s a guide on installing packages using the APK command: https://wiki.alpinelinux.org/wiki/Alpine_Linux_package_management#Add_a_Package
Update: Looks like you found your answer https://www.reddit.com/r/pinephone/comments/pdbdm6/pinephone_postmarketos_apk_command_not_found/
Hi Brad. I’ve tried many OTG adapters but none worked, What did you use?
In this demo, I just used the one that came with my Pixel 2 smartphone, but the USB-C “Convergence Dock” that came with my PinePhone postmarketOS Community Edition also works.
I’ll try one of those, Thanks!
I loved you video on installing apps with the apk command. Thanks
Comments are closed.