Installing packages on a running phone

This article explains how to install packages that were built with pmbootstrap on your phone via Wi-Fi or USB network.

pmbootstrap sideload
This method copies a package via SSH to your phone and installs it. It makes installing a single package relatively easy. If you need to install multiple packages with dependencies on each other, hosting a repository locally (see below) is recommended instead.

Connect your phone using USB Network (or Wi-Fi) and make sure you can login into it with SSH. Then excecute the following: replace arch with actual architecture (for example, aarch64).

Add  argument if you see the error about untrusted signature.

Add  if your device's SSH server is running on a non-standard port (not 22). This may be needed for example, for an image that is running using pmbootstrap qemu (see QEMU).

For Wi-Fi use your device's Wi-Fi IP address.

Host repository locally using a web server
This method is easier when you need to install multiple dependent packages at once, or simulate the regular upgrade process from repositories. For single packages,  is probably easier, see above.

Python http.server
Go to the pmbootstrap packages dir and start a web server:

Nginx
See Host a reverse_proxy to postmarketOS and Alpine_Repositories

Add the repository
Install your favorite editor and open  on your phone via SSH:

Add your own repository on top:

Copy the package signing keys
If you did not generate the postmarketOS installation from the same PC, which is now running pmbootstrap to build the packages you want to install, then you need to copy the package signing keys. Otherwise, apk will refuse to install the packages ("UNTRUSTED signature").

On your PC (replace  with the IP of your phone,   with your ssh username, mind the   at the end of the   command):

Run on your phone via SSH:

Use your repository
Now  should recognize your repository, and you should be able to install or upgrade packages built on your PC:

pmos-update-kernel
While devices in main and community categories are expected to update the kernel fully automatically, many Android devices currently need to run  after a kernel upgrade, to actually write the new kernel to the partition expected by the bootloader (see boot process). You should check the page for your device or it's platform to know if you need this extra step.

Run it manually
Install, figure out the kernel flavor (in the example below:  ) and update the kernel:

Automate with a script
If you're experimenting with mainline kernel and adding new features you might end up wanting to update your kernel and restart your phone very often. On the kernel building end you can use envkernel.sh +. That will produce a fresh new kernel package with the changes you made. Then you need to install that package to the phone.

Use this script to automate the steps above (adjust !):