Install LineageOS on channel keyboard_arrow_left​ Back to the overview ● Basic requirements ● Unlocking the bootloader ● Temporarily booting a custom recovery using fastboot​ ● Pre-install instructions ● Installing LineageOS from recovery ● Get assistance

Basic requirements warning

IMPORTANT: Please read through the instructions at least once before actually following them, so as to avoid any problems due to any missed steps!

1. Make sure your computer has adb​ and fastboot​ . Setup instructions can be found ​ ​ here​.​https://wiki.lineageos.org/adb_fastboot_guide.html 2. Enable ​USB debugging​ on your device ​(Internet search will help or go to settings, about phone, seven taps on the build number (at bottom), back to system, advance, select USB debugging)

Unlocking the bootloader info_outline

NOTE: The steps below only need to be run once per device. warning

WARNING: Unlocking the bootloader will erase all data on your device! Before proceeding, ensure the data you would like to retain is backed up to your PC and/or your account, or equivalent. Please note that OEM backup solutions like Samsung and Motorola backup may not be accessible from LineageOS once installed. I find it easiest to setup a directory for adb platform tools, then place the Lineage files there or any other files you need to sideload. For Windows you can open the command prompt at that location by hitting control and right click inside that directory window, scroll down to find the console start or power shell start here. Then everything will work (no file not found, or command not found errors). Forget about messing with the path command, for simplicity, the sideloaded files needs to be this way anyway.

1. Connect the device to your PC via USB. On the computer, open a command prompt (on Windows) or terminal (on or macOS) window, and type: adb reboot bootloader 2. You can also boot into fastboot mode via a key combination: a. With the device powered off, hold Volume Down + Power. ​ ​ ​ ​ Once the device is in fastboot mode, verify your PC finds it by typing: fastboot devices (it should return the device number, NOT a blank list) ​ 3. check TIP: If you see no permissions fastboot while on Linux or macOS, try running fastboot ​ ​ ​ as root. 4. Follow the instructions at Motorola Support to unlock your bootloader. You will ​ ​ ​ need to use the text edit app linked in the page to put together the code, look for it and you will be able edit all the data. The console window only lets you copy the full listing, so once you paste that in you can re-cut it down to size and then remove the carriage returns to make one sentence.

https://motorola-global-portal.custhelp.com/app/standalone/bootloader/unlock-yo ur-device-a info_outline NOTE: If your device is not supported by the Motorola Bootloader Unlock website, you may be able to use an alternative bootloader unlock method like SunShine, though they ​ ​ only support some devices/.

5. Since the device resets completely, you will need to re-enable USB debugging to continue. (NOTE: on occasion you will need to allow debugging on the phone, it ​ won’t break anything but it might not accept commands and you will wonder how you lost connection).

Temporarily booting a custom recovery using ​fastboot 1. Download a custom recovery - you can download one here. ​ ​ https://download.lineageos.org/channel

2. Connect your device to your PC via USB. 3. On the computer, open a command prompt (on Windows) or terminal (on Linux or macOS) window, and type:

adb reboot bootloader

4. You can also boot into fastboot mode via a key combination: a. With the device powered off, hold ​Volume Down + Power​ . ​ ​ Once the device is in fastboot mode, verify your PC finds it by typing: fastboot devices (must return device number, similar as before) ​ check no permissions fastboot fastboot TIP: If you see ​ ​ while on Linux or macOS, try running ​ ​ as root. check TIP: Some devices have buggy USB support while in bootloader mode, if you see fastboot fastboot getvar .. ​ hanging with no output when using commands such as ​ ​, fastboot boot ... fastboot flash ... ​, ​ ​ you may want to try a different USB port (preferably a USB Type-A 2.0 one) or a USB hub. ​In addition I found that you need to eliminate any other USB operations to simplify this job and also when the OS is loaded. I turned off my wifi too to keep the PC from doing work in the background. I found a 25% increase in speed from doing this.

Temporarily flash a recovery on your device by typing: fastboot flash boot .img

Ex: Fastboot flash boot lineage-17.1-20210124-recovery-channel.img

5. Yes G7 Play is an A/B device. The note below will not work. When you now switch into recovery mode be sure and hold the enter key for a few seconds so that the Lineage Recovery Starts. You will see the Lineage Logo. This recovery app has fewer features, so some of the next steps can not be taken. info_outline NOTE: Newer fastboot releases dropped legacy A/B support, so it might attempt boot__a boot__b boot_a boot_b boot to flash to ​ ​ / ​ ​ rather than ​ ​ / ​ ​ if you try to flash ​ ​. In this case, you must manually specify which slot to flash to based on what slot boot__a fastboot failed to flash to. For example, if fastboot fails to flash to ​ ​, you boot_a must flash to ​ ​. check TIP: The file may not be named identically to what stands in this command, so adjust accordingly. 6. Using the power button is the best way to do this step, opinion here

With the device powered off, hold ​Volume Down + Power​ , then select “Recovery ​ ​ mode” using Volume keys.

Alternatively, on some devices and recoveries you can use fastboot to boot directly into the freshly flashed or any other desired recovery: fastboot boot .img

check TIP: The file may not be named identically to what stands in this command, so adjust accordingly. ​ If you get the file name wrong as I’m sure we all do from time to time, we receive the classic file not found error message.

Pre-install instructions (​ All Steps Required)

In some cases slot ​b can be unpopulated or contain much older than slot a​ , ​ ​ leading to various issues including a potential hard-brick. We can ensure none of that will happen by the steps that follow which copy the contents of slot ​a to slot ​b. ​This step ​ ​ is NOT optional.

To do this, sideload the copy-partitions-20200903_1329.​ package by doing the ​ following:​https://androidfilehost.com/?fid=8889791610682929240

1. Download the ​copy-partitions-20200903_1329.zip file ​from the line above​. ​ 2. Sideload the ​copy-partitions-20200903_1329.zip package: ​ ○ On the device, select “Apply Update”, “Apply from ADB”, ​a device message will instruct you to enter the sideload command (next step) ○ On the host machine, sideload the package using: ​adb sideload copy-partitions-20200903_1329.zip ○ You will see all kinds of display content, don’t know how to capture it.

Installing LineageOS from recovery 1. Download the LineageOS installation package that you would like to install or build the ​ ​ ​ ​ package yourself. (Same link as for recovery above) ​ ○ Optionally, download additional application packages such as Google Apps (use ​ ​ the arm64 architecture). Only if you are nuts do this!!!!!!!! ​ ​ ​ 2. If you are not in recovery, reboot into recovery: ○ With the device powered off, hold Volume Down + Power, then select “Recovery ​ ​ ​ ​ mode” using Volume keys. 3. Now tap Wipe, Skip this step 3, and step 4, not a feature of Lineage Recovery ​ 4. Now tap Format Data and continue with the formatting process. This will remove encryption and delete all files stored in the internal storage. 5. Sideload the LineageOS .zip package: ​ ​ ○ On the device, select “Apply update”, then “Apply from ADB” ○ On the host machine, sideload the package using: adb sideload ​ filename.zip. ​ ○ Example: adb sideload lineage-17.1-20210124-nightly-channel-signed.zip ○ check TIP: If the process succeeds the output will stop at 47% and report ​adb: failed to read command: Success. Presently it stops at 47$ reports a time, then ​ ​ does a 1/2 install, then a 2/2 install and returns to the recovery screen. Then hit reboot from recovery. In my case it did two tries and then gives a fail report with two options: Retry, and Factory Data Reset. If so pick Factory Data Reset and the OS should start. 6. (Optionally): If you want to install any additional add-ons, run ​ ​adb reboot sideload, then adb sideload filename.zip those packages in sequence. I am ​ ​ ​ ​ guessing that these two commands are necessary to single shoot each addition so that it will not step on top of the previous. It will be necessary to obtain a “privacy” brower. Any factory install apps that remain can be removed from view by disabling the app. The recommendation I have read about is to put in MicroG, then FDroid, and Aurora Store. Do the settings for MicroG, Aurora Store before any other apps are installed. The install Duckduckgo…...

Here is the link to the MicroG, and Fdroid zip files that will sideload just like the OS. Duckduckgo can be installed from Fdroid.

https://downloads.nanolx.org/NanoDroid/Stable/

File names contain: Nanodroid microG, Nanodroid Fdroid.zip

info_outline(not sure about the Google Apps stuff) ​ NOTE: If you want Google Apps on your device, you must follow this step before booting into LineageOS for the first time!

7. Once you have installed everything successfully, click the back arrow in the top left of the screen, then “Reboot system now”. warning

WARNING: Depending on which recovery you use, you may be prompted to install additional apps and services. We strongly advise you to opt out of installing these, as they may cause your device to bootloop, as well as attempt to access or corrupt your data.

Get assistance If you have any questions or get stuck on any of the steps, feel free to ask on our ​ subreddit or in #LineageOS on freenode. I found help on Subreddit. ​ ​ ​ ​ https://www.reddit.com/r/LineageOS/