Kevin Boone

Some notes on installing Lineage OS on modern-ish Samsung Android devices

This article provides some supplementary notes about installing
Lineage OS on modern-ish Samsung devices, and rooting them (in that order). At the time of writing, the most modern device that Lineage supports is the S20 FE; the oldest is probably the S8. Unofficial versions exist for some other devices.

I’m not trying to supplant the official Lineage instructions, which are already quite thorough. All I seek to do is to add my own experiences, in the hope that I can save somebody some time and frustration.

Note
I install Lineage OS on my cellphones to de-Google them. It’s certainly possible to install Google stuff under Lineage OS, and also to install stubs of Google services to fool applications into thinking that these services are available. However, I’m specifically trying to avoid Google services, so I won’t be describing how to do any of that in this article (because I don’t know).

Please be aware that there’s a lot more I don’t know about the process of installing Lineage OS. I have successfully installed it on the S10, S10+, S10e, Note 9, and S5e (Wifi). The last of these is a tablet; the rest are smartphones. The installation process is the same for all of them once you get the custom recovery software installed (see below). It’s possible that you can install the custom recovery the same way on all devices, too – but the Lineage OS instructions are different in this regard for different devices, and I’ve generally followed them.

In particular, some devices are documented as using the Odin tool to install the custom recovery, others use Heimdall. More on this point later.

If you’re unsure about whether installing Lineage OS is right for you, please see at least the ‘Things to watch out for’ section at the end of this article. It might help you make up your mind.

Basic principles

Assuming that you’re starting from a stock, up-to-date Samsung device, installation and rooting has four main parts.

I should point out that installing Lineage OS does not require a rooted device, and it will not root the device itself. Lineage OS used to have its own mechanism for enabling root access, but the maintainers now recommend Magisk.

Prerequisites

You’ll need:

I would strongly recommend that, before going any further, you learn and practice the button-press combinations needed to be able to get into the various “special modes”. You’ll need to be able to do these fluently and at speed, or you’ll end up repeating various parts of the installation, perhaps several times.

How to get into special modes

Installing Lineage OS on a Samsung device requires being able to start the device in particular special modes: “download” mode, and “recovery” mode.

For full details you’ll need to check the specific instructions for your device on the Lineage OS website. However, I’ve found that the following work for all my Samsung cellphones.

If you’ve already installed Lineage OS – you’re trying to install Magisk for rooting, for example – the easiest way to get into the special modes is to do so directly from the Lineage user interface. To do this, enable the ‘Advanced restart’ feature from the Settings app. Then the power-off menu will have an additional ‘Restart’ button that allows direct entry into download mode or recovery mode.

If you don’t have Lineage OS installed yet – and you probably don’t, if you’re reading this – then you’ll need to learn and practice the finger-breaking button combinations below.

Download mode

This is the mode you need for installing a custom recovery image using the Heimdall or Odin utilities. With the device powered off, press and hold the volume-down and bixby buttons, then plug in the USB cable. Unless you have three hands, it takes some practice to complete these steps.

Recovery mode

This is the mode you’ll need for installing Lineage OS using the custom recovery menu. With the device powered off, press and hold volume-up, bixby, and power, for a long time, until the recovery screen appears.

If you’re currently running Android or Lineage OS, and your device is connected to a computer, you might be able to get into recovery mode by running adb reboot recovery. If this works, it might put the recovery utility directly into ‘sideload’ mode (see below), which will save a couple fo button-presses. But I’ve found it doesn’t always work for me.

Hard power-off

To power off when there seems to be no other way to do so, press and hold the volume-down and power buttons together, and hold them for at least ten seconds, or until the screen switches off.

This isn’t just for emergencies – there are steps in the official documentation that require a hard power-off as part of the installation.

From download mode to recovery mode

This is the most fiddly mode switch of all, and you have to be able to get it right. If you fail, you’ll probably have to install the custom recovery from scratch and try again.

With the device in download mode, and having finished downloading the custom recovery, do a hard power-off followed immediately by recovery mode. That is, hold volume-down and power until the screen switches off and then, within half a second or so, press and hold the volume-up, bixby, and power buttons together.

This process is very fiddly, and I get it wrong as often as right, even after practice.

Bootloader unlock issues

The first step in the installation of Lineage OS, or any custom ROM, is to unlock the bootloader.

The Lineage OS instructions say to enable developer mode on the device, and then find the ‘Enable OEM Unlocking’ control in the Settings app. What they don’t say is that you won’t even see this control if there is no WiFi connection. I have no idea why this is the case, and I’m not sure whether anybody else does. I’ve been caught out by this many times, because installing Lineage is usually the very first thing I do on a cellphone. So I usually rush through all the initial set-up steps, to get as quickly as possible to the Settings app. But if you don’t enable WiFi, you won’t be able to enable the bootloader unlock mode when you get there.

There are many reports of how certain devices don’t even have the ‘Enable OEM Unlocking’ control. These seem to be devices that are locked to some specific cellular carrier. I don’t think it’s possible to proceed without completing this step successfully.

Note
Although it’s stated in the Lineage installation instructions, it bears repeating: unlocking the bootloader will erase all data on the device and, even if you proceed no further, certain features of the device will be lost, particularly those concerned with media DRM. There’s really no going back, beyond this point.

Installing the custom recovery software

Depending on the device, the instructions say to use Odin or Heimdall. Although these utilities have many functions, only one is needed to flash the recovery utility. The second-trickiest part of the process is getting into ‘download’ mode to begin it (see above). Thereafter it’s just a matter of running the appropriate Odin or Heimdall commands, which are well-documented.

The trickiest part is getting from download mode to recovery mode without actually starting Android. The finger-breaker for this is also described above and, although I know I’m repeating myself, it’s good to practice it until you can do it without getting your fingers in a tangle.

The problem is that if you leave download mode without entering recovery mode, the device will reboot normally, and restart Samsung’s Android. Doing this will overwrite the custom recovery with the Samsung stock recovery, which is no use to us. So it’s crucial to go straight from download mode to recovery mode.

Using the custom recovery to install Lineage OS

When you boot into recovery mode, either now or after installing Lineage, you should see the Lineage OS custom recovery. This recovery utility has large, white text on a purple background and is touch-sensitive. If you see lots of tiny text, and the menus are not touch sensitive, then you’re not running the Lineage recovery, but the stock Samsung one. This is no use for installing anything except Samsung software.

So if you’re in this situation, you’ll need to retry the installation of the custom recovery.

Installing Lineage OS from the custom recovery is easy, and well-documented. You’ll need to use the recovery menus to perform a factory data erase, and then ‘Apply update’. You can then use the adb sideload command to send the appropriate Lineage OS image to the device. This will take a few minutes, and then you’ll be back at the recovery menu.

It’s possible to install Google stuff at this point and, according to the documentation, you need to do so before starting Lineage OS for the first time. I’ve never done this, so I can’t comment further. I just reboot here, and start Lineage OS.

Rooting using Magisk

This is now the approved way to root Lineage OS. Magisk has two parts to it – some firmware which is executed at boot time, and a regular Android app. I believe there are various ways to install these components; I’m just describing the method that works for me.

  1. Obtain the Magisk installer APK from GitHub.
  2. Enter recovery mode, and install the APK using adb sideload, as you did to install Lineage OS itself. It’s normal to get a ‘Signature verification error’ message at this point.
  3. Reboot into Lineage OS.
  4. You’ll see a new app, entitled ‘Magisk’, with a generic Android logo. This is just a stub to download the rest of Magisk. Run this app.
  5. When prompted, tell the downloader stub to download the full app.
  6. When the full app has installed, run it. You’ll be told that additional steps are required.
  7. When prompted, choose ‘Direct installation’. This will install some software and reboot the device.

To test that root access is now possible, I usually install a terminal emulator like Termux. Then I run su in the terminal. This should cause Magisk to pop up a confirmation box and, if you grant permission for root access, the prompt in the terminal will change from $ to #. Other software that requires root access should also work, although you’ll need to approve their access when Magisk prompts.

Things to watch out for