back to the beginning

First time install of LineageOS on Essential PH-1

Last updated: 2019-01-22

Upgraders go to this page!

LineageOS is an alternate version of the Android operating system for your phone. Rather than building it yourself the first time, I recommend you use the image provided by invisblek). However, his image includes Google apps by default. If you want to experience life without Google's apps you will have to build LineageOS yourself. If you want to use Google apps get LineageOS from here. You can still use these instructions to install.

WARNING: Moving from stock Android to LineageOS (including builds from various sources that use different build keys!) or back again will require restoring your phone to factory settings.
YOU WILL LOSE ALL YOUR DATA. YOU MUST COPY ANYTHING YOU VALUE OFF OF THE PHONE.


Download my build of LineageOS with no Google Apps (or build your own)


To flash back to stock:

If you want to remove LineageOS and return to stock Android follow the instructions here:

You will lose all your data so make a backup beforehand (see step for that below).


Required resources:

Websites for information and resources:


Prerequisites and required software:

All instructions assume you are running Linux. These instructions are for Ubuntu with minimum version of 16.04.

  1. Prepare environment (skip this if you built your own)
  2. You will need to install proper ADB (Android Debugging Bridge) tools for your platform. For Ubuntu 18.04 this is as simple as running

    sudo apt install adb

    If your distribution provides out of date tools you can obtain them directly from Google.

    Install the tools from Google:

    unzip platform-tools-latest-linux.zip -d ~

  3. Add these tools to your path add the following to ~/.profile
  4. # add Android SDK platform tools to path
    if [ -d "$HOME/platform-tools" ] ; then
    PATH="$HOME/platform-tools:$PATH"
    fi

    Run the following command to update your shell:

    source ~/.profile


Installing LineageOS

  1. (optional) BACK UP PHONE:
  2. If you are moving from another version of LineageOS, then you should do this. Versions built with different keys will not read the data partitions of other builds. See note regarding keys at top of this page.

    I don't know if this works; got it off the internet!

    sudo adb backup -apk -shared -all -f ph1.backup.ab

    To restore:

    sudo adb restore ph1.backup.ab

    Personally, I put everything I value in a syncthing folder and just use that for backup/restore.

  3. Unlock the boot loader
  4. Installing LineageOS will require you have an unlocked boot loader. You only do this the first time.

  5. Wipe phone
  6. If you are coming from stock you will have to wipe your phone with this command (it will ensure the phone is erased):

    sudo fastboot -w

  7. Reboot to recovery
  8. Type the following in your shell and wait for the phone to restart (your phone may prompt for permission):

    sudo adb reboot-bootloader

    To verify you can access the phone type:

    sudo fastboot devices

    If you see a device with the label "unauthorized" you forgot to give your computer permission to access your phone through the adb interface.

  9. Install TWRP
  10. TWRP gets written to the boot partition.

    sudo fastboot flash boot twrp-3.2.3-0-mata.img
    sudo fastboot reboot

    After a few moments TWRP will start.

  11. Turn on sideloading
  12. You most likely won't be able to control TWRP with the touchscreen. You can install Lineage without using the touch screen.

    If something goes wrong and you need to restart the phone depress the volume down button while the phone reboots.

    (NOTE: I had to unplug/replug my phone and wait until my computer acknowledged the phone before issuing each of the next two commands.)

    sudo adb shell twrp sideload

    The phone will show a message that sideloading is enabled.

  13. Install LineageOS
  14. sudo adb sideload lineage-16.0-date-UNOFFICIAL-mata.zip

    (NOTE: Progress might appear to hang at 47% but the phone will show it is in step 2; be patient. The phone will return to TWRP main screen when it finishes.)

    (I don't do this but I expect you can install other things like Magisk or gapps here the same as above: sudo adb sideload images.zip)

  15. Reboot phone
  16. sudo adb reboot

  17. If you get a boot loop
  18. If you phone boot loops or takes more than a few minutes to start into LineageOS then boot to recovery and reset to factory. This can happen if the OS cannot read the data partition.

    To boot to recovery hold the volume up button down until the recovery menu appears. Use the volume buttons to select factory reset and the power button to execute. This will reset the phone and it will start properly.

    This can also be done from like this:

    sudo fastboot -w

  19. Disable USB debugging
  20. Settings - System - Developer options - Android debugging

    It is safest to keep USB debugging disabled until you need it. Go to the developer options menu in settings and disable it.

  21. Re-enable your lockscreen (and fingerprints if you do that)
  22. Settings - Security - Screen Lock

back to the beginning

Something need fixing? Contact me: