[HOWTO] install /e/ on a Samsung device from a GNU/Linux PC successfully

1) Download /e/OS.zip

.

originaly Forked from @manish’s famous howto for fastboot devices… :pray: namaste
Special thanks to @Superman and @Anonyme
I will improve it…

.

Mission :

.

Install /e/OS on the ROM of your compatible Samsung device with a GNU/Linux PC

  • from a Terminal on the PC using the recommended adb sideload method
    or
  • from TWRP on the Device using the alternate SDcard or internal storage method
    .

if you are a macrosoft windobe user, try this excellent howto
.

Prerequisites:

  • A compatible Samsung smartyphone or tablet, with more than 50% battery charge.
    running Samsung Firmware. upgraded and updated
    ( STOP to Android 9 pie ! )
    or already running a custom android OS.
    with complete backup of important data on a PC or an external drive or source.
    without PIN code, or password, or gesture, or connected to a gogol account or SIM lock from a carrier
    ( in those case you need to flash first the latest “free of carrier” stock firmware for your country area )

  • a GNU/Linux PC, as example an Ubuntu Studio LTS.

  • Patience to follow steps i.e. unlock the bootloader, flash custom recovery and finally privacy-friendly /e/OS on the ROM of your android Samsung device

.

Preparation :

1) Download /e/OS.zip

.
On your PC ( sideload method ),

or

On your SDcard ( SDcard method ),
.

it take times, so do it first,
you can follow all others steps during the download.
Download the device specific image of /e/OS
build for the ROM of your specific device from :

your model number, avialable in the
"settings menu" -> Plus/System -> About phone -> “Model number”
must be supported by the device code name of the build you choose.

example :
model name : Galaxy s7
code name : herolte
model number : SM-G930F, SM-G930FD, SM-G930S, SM-G930K, SM-G930L, SM-G930W8
(https://github.com/LineageOS/lineage_wiki/blob/master/_data/devices/herolte.yml)

Screenshot_20201025-211339_Browser

Screenshot_20201025-211303_Browser

if your device already run another custom OS, you may have TWRP already installed, so go to step .7). or .8)

if your device already run /e/ and you want to update or upgrade without data loss, see this howto

if your device run an Android-Official-Stock-Vendor version ( realised by your Carrier / Samsung / Gogol )
this step by step guide is for you.

Samsung devices comes with three booting modes
boot to system mode.
boot to recovery mode.
boot to download mode. ( similar to fastboot mode )

.image

you are decided to try /e/ on your Samsung device,
so, you need to replace the existing system by /e/OS.

  • To modify or change the /system partition of your device, you need to boot into a custom recovery mode that allow you to do that. ( TWRP, from the Team Win Recovery Project ).
  • To modify or change the /recovery of your device, witch is located on the /boot partition, you need to unlock the bootloader. (the heimdall-flash tool )
  • To unlock the bootloader of your device, you need to communicate with the device. ( USB adb, the Android Debugging Bridge )
    .

2) Download TWRP.img

On your PC,

Download the device codenamed specific .img file to patch the /boot partition of your device to replace the stock-recovery by a custom recovery called TWRP, the Team Win Recovery Projet from :

twrp version 3.4.0-0 is designed for android 10/Q don’t choose it
for installing /e/OS 7/nougat, 8/oreo, 9/pie download an older version like 3.3.1-0

.

3) install the flashing tools

On your PC

Install ADB the Android Debug Bridge,
( Fastboot for flashing others brand android devices ),
and Heimdall the Open Source Flashing Tool for Samsung devices

Ubuntu is used for the purpose of this guide. Kindly change the commands and package names, if any for your distribution

  • open a Terminal app to execute the following command :

$ sudo apt update
$ sudo apt upgrade
$ sudo apt install android-tools-adb
($ sudo apt install android-tools-fastboot)
$ sudo apt install heimdall-flash
($ sudo apt install heimdall-flash-frontend)

  • or

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install android-tools-adb
($ sudo apt-get install android-tools-fastboot)
$ sudo apt-get install heimdall-flash
($ sudo apt-get install heimdall-flash-frontend)

  • When done check with adb version command to verify.

$ adb version

A result as follows shall appear on your terminal screen.

Android Debug Bridge version 1.0.39
Version 1:8.1.0+r23-5

  • You can verify Heimdall is functioning by opening a Terminal and running

$ heimdall version .

.

  • Other method :

      • open a Terminal and type :
      • $ unzip /path/to/heimdall_ubuntu.zip -d /tmp
        $ cp /tmp/bin/heimdall* /usr/bin/
        $ rm -rf /tmp/bin

For others GNU/Linux :

you may build heimdall, there is a guide…
I did it…for my Linux Mint Debian Edition version 3 cindy

.

4) Allow flashing

On your phone

allow USB debugging
allow OEM unlock (on android 7 nougat or later)

  • Go to the >Settings menu >More/System , scroll down, tap on 'About phone’, scroll down,

in android 7 nougat :
image image

in android 5 lollipop
image image

in android 4 jelly bean :
image

  • Tap 7 times on ‘Build number’ until it unlocks the Developer options mode as seen in the images below. Kindly enter password/PIN when asked.

image

Yay! You are a temporary developer now without any coding experience whatsoever!

  • In Settings, navigate to More/System and scroll down to open Developer options.

  • in Developer options, allow OEM unlocking (on android 7 nougat or later)

in android 9 pie
image

  • In Developer options allow USB debugging under DEBUGGING

in android 5 Lollipop
IMG_18221

  • There is a disclamer :

image

  • Tap OK to Allow USB debugging and enable it.

image

  • Connect your smartphone using USB cable to GNU/Linux PC to whitelist USB debugging from it to unlock bootloader .
  • There is a disclamer :

image

  • Tap OK to continue.

.

Let’s roll !

.

5) Unlock the Bootloader

Warning: This process will completely wipe all data in the internal storage of your smartphone, please make sure you have a full backup of critical data on your smart phone

  • Tip :

$ adb reboot bootloader

or

  • unplug the device from the PC
  • Power Off the device,
  • Boot to Download mode :
    hold Volume Down + Home + Power.

IMG_17971

  • Now you can plug the device to your PC with a good data USB cable

From the Terminal application on GNU/Linux PC,
fastboot commands don’t work with samsung devices, you must use heimdall commands,

  • execute the following command to unlock the bootloader :

$ heimdall print-pit

It results that the device reboots

.

Congratulation !
.

the bootloader of your Samsung device is unlocked and the device is factory reseted, now rebooting…

  • Redo the setup quickly. Since all the settings have been wiped from your device.

  • Once done, you have to re-enable the Developer options,

  • re-enable the USB debugging in the Developer options with steps above :

  • Go to the Settings menu , scroll down, tap on 'About phone’ , scroll down,

  • Tap 7 times on ‘Build number’ until it unlocks the Developer options mode as seen in the images below. Kindly enter password/PIN when asked.

image

  • Yay! You are a temporary developer now without any coding experience whatsoever!

  • In Settings , navigate to System and scroll down to open Developer options .

image

image

  • In Developer options enable USB debugging under DEBUGGING

image

  • There is a disclamer :

image

  • Tap OK to Allow USB debugging and enable it.

image

  • Connect your smartphone using a good USB cable to your GNU/Linux PC to whitelist USB debugging from it.
    There is a disclamer :

image

  • Tap OK to continue.
    .

6) Flash the custom recovery TWRP

  • Tip :

$ adb reboot bootloader

or

  • Unplug the device from the PC
  • Power Off the device,
  • Boot to Download mode :
    hold Volume Down + Home + Power.

IMG_17971

  • Now you can plug the device to your PC with a good data USB cable

  • From terminal application on PC, navigate to file path where you have downloaded the TWRP.img, execute the following command to install a custom recovery software called TWRP the Team Win Recovery Project .

$ heimdall flash --RECOVERY twrp-3.3.1-0-herolte.img --no-reboot

  • It will result in the following output on PC:

target reported max download size of 536870912 bytes
sending ‘recovery’ (33684 KB)…
OKAY [ 1.048s]
writing ‘recovery’…
OKAY [ 0.346s]
finished. total time: 1.394s

Try :

$ adb reboot recovery

or

  • To get out of the Download mode you must Force Power Off your Samsung device,
    unplug the device,
    hold Volume Down + Power.
    release when you see the screen turn off…

…IT IS THE CRUTIAL STEP !..

  • immediately Boot to Recovery before any other boot mode attempt,
    hold Volume up + Home + Power.
    release when you see the very little blue line in the bottom of the screen…

image

You must see the TWRP flash logo,

image

and the welcome screen :

image

if you see something like that :

image

It FAILED, this is the Official Stock Vendor Samsung / Gogol Firmware Recovery screen !
Please re-read and retry the flashing process of TWRP.

.

7) install /e/ !

Now the easiest part,
Install the image of /e/OS on the rom of your Samsung device with TWRP from your GNU/Linux PC using the sideload

this is the Welcome screen of TWRP recovery

image

  • —i> Swipe to Allow Modifications

this is the TWRP main menu

image

  • Tap Wipe from Main Menu.
    image

  • Tap Format Data therein to continue.
    image

  • Type yes in the text field to continue.

image

Once done a successful result as seen in the image below appears.

image

This will remove encryption as well as delete all files stored on the internal storage.

  • Tap Back, return to the main menu,

image

  • choose reboot,

image

image

  • and tap recovery

image

image

  • unselect “prompt to install TWRP app…”
    and “install as a System app”,
  • tap on “do not install”.

the device reboot to TWRP

image

  • From the main menu, choose wipe,

image

and tap Advanced Wipe .

image

  • Select the Cache and System partitions to be wiped and then Swipe to Wipe .

image

  • Once done a successful result as seen in the image below appears.

image

  • tap back to the main menu

image

  • choose Advanced

image

image

  • Tap ADB Sideload

image

  • Select Wipe Dalvik Cache and Wipe Cache

image

  • then Swipe to Start ADB Sideload

image

on your PC

  • In the Terminal application on your GNU/Linux PC, navigate to file path where you have downloaded the /e/OS.zip to execute the following command:

adb sideload e-0.11-n-2020082970471-dev-herolte.zip

  • It will result in the following output on PC when finished:

serving: '/home/modi/Downloads/e-0.11-n-2020082970471-dev-herolte.zip' (~47%) Total xfer: 1.00x

  • On your smartphone, a successful result as seen in the image below appears.

image

  • Tap Reboot System

20190411_145926.jpg

  • wait several minutes…

to boot into freshly installed /e/OS on your Samsung device.

Screenshot_20200425-122249

Screenshot_20200425-122052

  • Voila! Easy, isn’t it?

If you encounter an “error 7”,
20190411_145522.jpg
refer to this topic .
This could also be due to the fact that :
your TWRP version isn’t compatible with the ROM you are trying to install,

      • https://twrp.me/Devices/Samsung/.
        twrp version 3.4.0-0 is designed for android 10/Q don’t choose it
        for installing /e/OS 7/nougat, 8/oreo, 9/pie download an older version like 3.3.1-0

Thanks for reading !
Share your feedback.

.

8) Install the image of /e/OS on the ROM of your Samsung device without computer, with TWRP using the SDcard method

(writted by @Anonyme)

Now you’re in TWRP, congratulations, you’ve done the hardest part. Let’s detail the following procedures in several sub-steps.

A) Delete existing smartphone content

  1. Before you reach the main menu, a message may ask you if you want to open TWRP read-only (i.e. no risk of deleting or changing anything) or not. This option shouldn’t be chosen (since we want to install a new operating system). Slide the bottom arrow from left to right.TWRP may also ask you for a password, which is your phone password.

  2. a)

image

  • Tap Wipe from Main Menu.
    image

  • Tap Format Data

  • Type yes in the text field to continue.

image

  • Once done a successful result as seen in the image below appears.

image

This will remove encryption as well as delete all files stored on the internal storage.

  • Tap Back, return to the main menu, choose reboot ,

image

  • image

image

  • and tap recovery
    image

the device reboot to TWRP

  1. b)
  • From the main menu, choose wipe ,

20190411_101134.jpg

image

20190411_101833.jpg

and tap Advanced Wipe .

image

  1. Select the following items to delete and nothing else :
  • Dalvik / ART Cache
  • Data
  • Internal Storage
  • cache
  • system

20190411_101858.jpg

  1. Validate by dragging the “Swipe to Wipe” arrow from left to right.If red error messages show up, your phone is probably encypted but TWRP can’t decrypt the /data partition (it’s a common issue on Samsung phones).To solve that problem, go to Wipe > Advanced wipe, select “data”, click on “Repair or Change File System”, then on “Change filesystem”. Select exFAT (or another one if it doesn’t work, it doesn’t matter), then swipe from the left to the right. Redo the manipulation but this time select ext4 (which is the original file system) then slide from the left to the right.
    Go to the 8)A)1. part of the howto.
  2. Return to the main menu using the virtual buttons at the bottom of the screen.

B) Transfer the /e/ ROM to the internal storage of the smartphone

The previously downloaded /e/ ROM is waiting in the warm on your computer, so you need to transfer it to your smartphone’s internal storage so that TWRP can use it.

  1. Connect your smartphone to the computer.
  2. Copy the ZIP folder of the /e/ ROM (without unzipping) (right click on it and then “Copy”).

dossier zip e.PNG

  1. Paste it into the internal storage of your smartphone. To do this, in the file explorer you are in, click on “This PC” then on your smartphone, then on “Internal storage”. Paste here, next to the “TWRP” folder (not inside).

peripherique.PNG

  1. Unplug your smartphone once the transfer is complete.

C) Install /e/

Everything is ready, all that remains is to install /e/.

  1. In the TWRP main menu, click on “Install”.

20190411_101134.jpg

  1. Select the .zip file you just copied/pasted. It should appear directly if you have pasted it at the right place.

20190411_101638.jpg

  1. To confirm the flash of your smartphone, slide the “Swipe to confirm Flash” arrow from left to right.

20190411_101649.jpg

  1. A blue loading bar or a shiny empty bar should appear. After a few minutes at most, the installation is completed.

20190411_145522.jpg

If you encounter an “error 7”, refer to this topic .
This could also be due to the fact that :

  • your TWRP version isn’t compatible with the ROM you are trying to install,
  1. Click on “Wipe cache/dalvik” at the bottom left, confirm if necessary.

20190411_145702.jpg

  1. Click on “Reboot System”. You can choose whether or not to install the TWRP application on /e/ and choose whether or not you want this application to be a system application. Since it’s not useful, I preferred to click on “Don’t install TWRP App” and DO NOT drag the arrow from left to right (this would have resulted in its installation).

9) Enjoy your digital sovereignty

The animation of the /e/ logo should now appear on your screen for several minutes. Wait, then configure your device as you wish.

20190411_145926.jpg

20190411_151047.jpg

20190411_151608.jpg

If you have any problem or correction to make so that this tutorial can be accurate to the word, do not hesitate :wink:

3 Likes