Disclaimer: those are basically the steps described on the LineageOS wiki. Check the wiki for updated information.
Prerequisites#
- Phone unlocked (OEM unlock / Mi unlock)
- USB debug enabled
Flashing the vendor boot partition#
Download vendor_boot file (vendor_boot.img
) from here
from the directory named with the latest date. For example, https://mirror.math.princeton.edu/pub/lineageos/full/alioth/20220528/vendor_boot.img.
Reboot the phone in bootloader/fastboot mode:
Flash the vendor boot image:
Temporarily booting a custom recovery#
Download Lineage Recovery image. For example, https://mirrorbits.lineageos.org/recovery/alioth/20220528/lineage-19.1-20220528-recovery-alioth.img.
Temporarily flash the recovery image on our device (we are already in fastboot mode from previous steps):
Note: In my case it flashed to boot_b
partition.
Now reboot into recovery to verify the installation.
Ensuring all firmware partitions are consistent#
To avoid issues, we'll copy the contents of the active slot to the inactive slot.
Sideload the copy-partitions-20210323_1922.zip
:
- Download the
copy-partitions-20210323_1922.zip
file from here. - Sideload the
copy-partitions-20210323_1922.zip
package:
- On the device, select Apply Update, then Apply from ADB to begin sideload.
- On the host machine, sideload the package using:
adb sideload copy-partitions-20210323_1922.zip
- Click on Yes (install anyway) when it says Signature verification failed (because it's made by LineageOS developers but is not signed with official keys)
- Return to previous menu with the left arrow, then reboot to recovery by tapping Advanced, then Reboot to recovery.
Installing LineageOS from recovery#
- Download the LineageOS installation package that you would like to install. For example https://mirrorbits.lineageos.org/full/alioth/20220528/lineage-19.1-20220528-nightly-alioth-signed.zip.
- Download Google Apps addon from here. For example, mobile version Lineage 19.1 (android 12.1) nano package arm64 architecture from MindTheGapps:
MindTheGapps-12.1.0-arm64-20220416_174313.zip
. - We already are in recovery mode from previous steps
- Now tap Factory Reset, then Format data / factory reset and continue with the formatting process. This will remove encryption and delete all files stored in the internal storage, as well as format your cache partition (if you have one).
- Return to the main menu.
- Sideload the LineageOS
.zip
package:
- On the device, select Apply Update, then Apply from ADB to begin sideload.
- On the host machine, sideload the package using:
adb sideload lineage-19.1-20220528-nightly-alioth-signed.zip
.
- To install Google Apps addon:
- Return to the main menu
- Click Advanced, then Reboot to Recovery
- Then when your device reboots, click Apply Update, then Apply from ADB
- Sideload Google Apps:
adb sideload MindTheGapps-12.1.0-arm64-20220416_174313.zip
- Click on Yes (install anyway) when it says Signature verification failed (because it's not made by LineageOS developers and so is not signed with official keys)
- Once you have installed everything successfully, click the back arrow in the top left of the screen, then Reboot system now.