Repairing a broken installation

There are a few options to recover data and attempt to recover the OS.

Note

These instructions are relatively technical in nature and should only be performed by someone comfortable with technical instructions.

Back up whatever files you need from your device. You can do this by booting Jumpdrive on the Librem 5 and copying your files to a Linux PC using the steps below:

Back up important files using Jumpdrive

Download and extract Jumpdrive

Follow these instructions on a Linux host computer:

  1. Download the latest build

  2. Open the Files app, and select Downloads on the left side bar

  3. Find purism-librem5.tar.xz and right-click it to show the menu

  4. Select Extract Here

  5. Open the new folder, purism-librem5

  6. Right-click in the blank space and select Open in Terminal

  7. In the terminal, run this command to install uuu: sudo apt install -y uuu

  8. If prompted for your password, type it and press Enter. Nothing will be shown while typing your password, for security reasons, just type it and press Enter.

  9. Leave the terminal open and proceed to the next steps.

Put the Librem 5 in flash mode

Note

This does not affect your stored data on the Librem 5.

  1. Fully power off the Librem 5

  2. Turn off all hardware kill switches on the Librem 5(move all to the “bottom” position toward the bottom of the phone)

  3. Remove the battery from the Librem 5

  4. Plug in the USB cable to your Linux PC

  5. Hold the volume-up button on the Librem 5

  6. Plug in the USB cable to the Librem 5. The red light should blink, and you should not see the green light

  7. Reinsert the Librem 5 battery. The red light will become solid

  8. Release the volume-up button on the Librem 5

Start Jumpdrive and open the Librem 5 disk on your PC

  1. On your Linux PC, in the terminal you opened, run this command: sudo ./boot-purism-librem5.sh

  2. Type your password if prompted and press Enter. Nothing will be shown while typing your password for security reasons; just type it and press Enter.

  3. After a few seconds, the Librem 5 will show an image and say “Jumpdrive is running”

  4. Your PC will prompt for a passphrase to access the Librem 5. Enter the passphrase you use when booting the Librem 5. The default is 123456. Then click Unlock.

Retrieve Files

  1. Open Files or return to the window you opened in step 1.

  2. Look for the Librem 5 disk in the left sidebar. For Librem 5 and Librem 5 USA, you will see 31 GB Volume. For Liberty Phone, you will see 127 GB Volume. Select that volume.

  3. Open the home folder, then the purism folder.

  4. This is your home directory on the Librem 5. Locate any files you would like to save, and copy them to your PC.

You can chroot into the Librem 5 installation and try repairing the installation. I’ve included some repair steps that might help, but you might need to look around to see what the actual problem is and improvise.

Try to repair your installation

Open a Terminal in the Librem 5 root

  1. Use lsblk to see where the root and boot partitions are mounted. We mounted root above, GNOME probably mounted boot automatically already. On PureOS/Debian, it’ll be something like /media/<user>/<uuid>

  2. cd to the root partition, if you list with ls you should see bin, dev, boot, etc and other directories.

Mount the boot and system directories needed for chroot

  1. Bind-mount the boot partition: sudo mount -o bind /media/<user>/<uuid> ./boot (use the location found above, and don’t forget the . in ./boot

  2. sudo mount -o bind /dev ./dev

  3. sudo mount -o bind /sys ./sys

  4. sudo mount -o bind /proc ./proc

chroot into the installation

  1. Install these PureOS/Debian packages if you don’t already have them: qemu qemu-user-static binfmt-support

  2. chroot into the phone OS: sudo chroot . (still in the Librem 5 root directory)

Check for common problems

Important

Be sure to execute these commands inside the chroot

  1. Check if your boot partition is full: df -h /boot (we’ve seen this cause a failure to update)

  2. If it has less than 100 MB free space, try to remove dpkg backup initrds: rm /boot/initrd*.dpkg-bak

  3. Check again: df -h /boot

  4. If it still has less than 100 MB free space, try to remove any old kernels: apt autoremove (this may remove other unreferenced packages if you have any)

  5. Try to repair any broken packages: apt --fix-broken install

Clean up

  1. Exit the chroot: exit

  2. Unmount partitions from the chroot (in the chroot directory): sudo umount ./{boot,dev,proc,sys}

  3. Close the terminal

  4. Unmount the Librem 5 using the eject button in GNOME Files

  5. Unplug the USB-C cable from the Librem 5

  6. Hold the power button on the Librem 5 to shut off

  7. Try to power on the Librem 5 again