From Leurent
Jump to: navigation, search


LineageOS is a Mobile OS based on Android AOSP ( Android Open Source Project) that allows you to

  1. Keep your old phone receiving updates once your Hardware Provider stops supporting your Phone
  2. Get Rid of all pre-installed Sony / Samsung / Google preinstalled app
  3. (optional) Re-Install only the bare minimum from google ( Play Store ). Then you can reinstall only what you need.

Download and Install LineageOS

The LineageOS Install Tutorial is well designed, so there is not need to add much, here are the main steps you need to perform

Verify that your phone is supported

Before starting anything, verify that your phone is supported by LineageOS, otherwise, there is no need to read this page. Check if you can find your phone in https://download.lineageos.org/

Backup : Make sure there is nothing on your phone that you want to keep

Make sure that you don't have anything on your phone that you would like to keep ( Contacts / Photo / SMS / Whatsapp / ...). Personally, I don't need to retrieve anything, everything is backup on Nextcloud using Nextcloud_Leurent !

  1. (Contacts) Make sure your contacts are stored somewhere ( In Nextcloud_Leurent or https://contacts.google.com/ )
  2.  (Photos) Make sure your photos are stored somewhere ( In Nextcloud_Leurent or https://photos.google.com/ or plug your phone to your Computer to backup Photos (DCIM folder) )
  3.  (Whatsapp) Open the app, go in the backup menu and force a backup to the Cloud ( Or in Nextcloud_Leurent )

Install LineageOS

  1. Connect to https://download.lineageos.org/ and go on the page of your phone ( ex: for Nexus 5x https://download.lineageos.org/bullhead )
  2. Download the last version of the OS ex: "lineage-15.1-20181022-nightly-bullhead-signed.zip" for me
  3.  Read the "Device info" section ( Look for "Supported versions" and "Architecture" you will need this information to download the opengapps)
  4. (opengapps) Optional to install Play Store. Download the https://opengapps.org/ version for your phone
    1. Platform : Select the one you did see in the "Device info" ( ex: ARM64 for Nexus 5x )
    2. Android: Select the matching OS version (Android 8.1 matches LineageOS 15.1 , Android 9 patches LineageOS 16.0 )
    3. Variant: Selet the variant you want to use depending of how much google services you want ( mini / micro / nano / pico ). I currently use nano version
  5. Follow the "Installation instructions". You will find some helper below to install adb or fastbook ot to backup your phone

Android SDK Tools

Install ADB and Fastboot

Simply read https://wiki.lineageos.org/adb_fastboot_guide.html it is well written.

Here is a list of alternatives

  • (Brew) If you have brew on your MacBook brew install android-platform-tools
  • (Debian) : Use apt install android-tools-adb fastboot

Flash New Vendor + Radio + Bootloader Image after a LineageOS Upgrade

Download last version of the factory image https://developers.google.com/android/images#bullhead

MBP-de-Marc:bullhead-opm7.181205.001 marc$ fastboot flash vendor vendor.img
target reported max download size of 536870912 bytes
erasing 'vendor'...
OKAY [  0.110s]
sending 'vendor' (190332 KB)...
OKAY [  4.281s]
writing 'vendor'...
OKAY [  2.936s]
finished. total time: 7.328s

MBP-de-Marc:bullhead-opm7.181205.001 marc$ fastboot flash radio radio-bullhead-m8994f- 
target reported max download size of 536870912 bytes
sending 'radio' (56630 KB)...
OKAY [  1.369s]
writing 'radio'...
OKAY [  0.723s]
finished. total time: 2.093s

MBP-de-Marc:bullhead-opm7.181205.001 marc$ fastboot flash bootloader bootloader-bullhead-bhz32c.img 
target reported max download size of 536870912 bytes
sending 'bootloader' (4610 KB)...
OKAY [  0.192s]
writing 'bootloader'...
OKAY [  0.254s]
finished. total time: 0.446s


TWRP stands for TeamWin Recovery Project, and allows you to change the bootloader on your phone to be able to change the OS and perform full backups.

Install TWRP

The install process is handled during the installation of the LineageOS. You can retrieve it from https://twrp.me/Devices/ and will need fastboot to install it

Backup your entire phone

  1.  Plug your phone on your PC
  2.  Type the command "adb reboot recovery" to reboot your phone in recovery mode to be able to perform a full backup
  3. Type the command "adb backup --twrp" to start a full backup
  4. Once it is finished, use the reboot system button
MBP-de-Marc:TWRP_BACKUP marc$ adb reboot recovery

MBP-de-Marc:TWRP_BACKUP marc$ adb backup --twrp
Now unlock your device and confirm the backup operation...

Restore your backup

  1. Open a terminal
  2. Go in the folder where you stored the backup
  3.  Use the adb restore backup.ad command
MBP-de-Marc:~ marc$ cd Archives/LineageOS/bullhead/TWRP_BACKUP/
MBP-de-Marc:TWRP_BACKUP marc$ ls
MBP-de-Marc:TWRP_BACKUP marc$ adb restore twrp_backup_bullhead_201810_full.ab