Terminal cheat sheet



Here's a small reference for working with postmarketOS/Alpine Linux.

Package management
The package manager in postmarketOS is called, the Alpine Package Keeper. The list of packages can be found at pkgs.alpinelinux.org and pkgs.postmarketos.org.

Installing a package

Uninstalling a package

Upgrading the system. The  option allows downgrading packages to what's available in the repository. It is generally recommended to always use this option, especially on stable releases, to ensure that any package reverts make it to your device.

Run various package repair strategies, e.g. running failed installation scripts again:

Listing installed package versions (add  to filter for a specific package):

Installing build dependencies:

The repositories are stored in  as one repository url per line. There's also  which is a list of packages that are explicitly installed. It's possible to add/remove packages from this list and then running  to apply those changes. The Alpine Linux wiki has a page comparing apk to other popular distros, with many helpful examples.

New installations of postmarketOS let apk ask for confirmation by default. If you don't want this, delete.

Service management
The service manager in postmarketOS is OpenRC. The basic service management is done with the familiar  command.

To enable or disable services on boot you use the  command.

Log files
By default postmarketOS uses the busybox logging daemon for the syslog and it's configured to log to memory only. The  command is used to read the in-memory log. Writing standard output and standard error of a system service to the filesystem can be achieved by setting  and   to file paths in its service script, as described in the manual page.

ModemManager logs to syslog by default as well, but prints almost nothing until manually increasing the log level with. Be aware that especially ModemManager logs a lot of sensitive information, such as phone numbers, text messages, IMEI, cell towers, etc!

Most user interfaces use tinydm to start the session in postmarketOS, which logs to.

A discussion to possibly change logging defaults is in.

Man pages
Man pages are not installed by default and are seperate from the normal packages. The  package is a metapackage that will pull in all the documentation for the software you have installed. You can also install only the documentation you need by not installing the  package but installing the specific documentation subpackage. For example for vim documentation you can install

Changing your shell
Since the pmos installations are based on busybox the default shell is, which is comparable to. There are multiple shells packaged in Alpine if you want something better: