This was really bothering me because the reflashing instructions here, Reflashing the Librem 5 – Purism, and here, Reflashing the Phone, are wrong.
Therefore, here is my new tutorial and post so people can find it in search:
I recommend having a Linux computer running a current version of Debian, but most modern Linux distros will likely work.
Reflashing the Librem 5 is the best way to remove your personal data and put the phone back into factory defaults.
Warning, this procedure will completely erase everything on the device! Make a backup beforehand!
The Librem 5 gets reflashed from a separate 64-bit x86 computer running PureOS (or booted from the live PureOS disk).
Reflashing from that computer is as simple as installing the needed packages:
sudo apt install git python3-jenkins python3-tqdm uuu
Downloading the flashing scripts:
git clone https://source.puri.sm/Librem5/librem5-flash-image.git
And flashing the phone for Evergreen (mass-produced version)
cd librem5-flash-image sudo ./scripts/librem5-flash-image --variant luks (or --plain) --stable
Luks is the encrypted version and plain is unencrypted. If you simply use --stable, then I believe the default is for the image to be encrypted. Also,
(Additionally, as @Franky Flawless points out, the Byzantium image being fetched from storage.puri.sm has an old timestamp:
Index of /librem5/images/byzantium/2023.06/librem5r4/luks/artifact/
There are a few newer Byzantium images with LUKS, but by default they are not fetched by the script:
https://storage.puri.sm/librem5/images/byzantium/2024.04/librem5r4/luks/artifact/
https://storage.puri.sm/librem5/images/byzantium/latest/librem5r4/luks/artifact/)
Once the script downloads the image, you’ll be prompted to attach the Librem 5 for flashing. The phone itself will not provide an indication of the boot mode – the script will simply continue once you follow these steps:
Ensure that the phone is switched off. Enter the flashing mode by holding volume-up button while turning the phone on.
If it’s not detected, follow these steps:
In sequential order:
- Hold the volume-up button.
- Hold the power button until the Librem 5 turns on.
- Release both buttons once the LED changes to orange.
Turn all Hardware-Kill-Switches off
Remove battery Hold volume-up Insert the USB-c cable: (red light blinks, no green light) Reinsert the battery: (red light is constantly on, the script will continue) Release volume-up
Note: USB Cable
Some USB-C cables may need to be plugged into the phone with a particular orientation. If the instructions above do not appear to work, try flipping the USB-C end of the cable over and replugging it into the phone.
Using the proper USB cable can make a difference and you should try different cords if you are having a problem.
Successful output will look something like this:
uuu (Universal Update Utility) for nxp imx chips – libpureos/1.2.91+0git6b465-62-g9c56e46
Success 1 Failure 0
Remove the USB C cable and hold down the power button for 15-18 seconds to reset the phone.
Your phone should now be running the latest image.
If anyone feels like they need to add something or to have me change something, please do let me know. I wanted to post this to help others.