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

update : I have improved it … as …

[HOWTO] an Unified Install Guide Project for /e/

.



.

originaly Forked from @manish’s famous howto for fastboot devices… :pray: namaste

Special thanks to @Superman and @Anonyme

.

(1) Download /e/OS

(2) Download TWRP

(3) install the flashing tools

(4) Allow flashing

(5) Unlock the Bootloader

(6) Flash the custom recovery TWRP on your device

(7) install /e/ from your computer, with TWRP on your device using the sideload method

or

(8) Install /e/ without computer from your device, with TWRP using the SDcard method

.

Mission :

.

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

  • from a Terminal on the Computer, 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 80% battery charge.

running Samsung Firmware. upgraded and updated ( if you want, you can first flash a Samsung Firmware with heimdall-CLI or with heimdall-GUI )

Or already running a custom android OS ( or custom recovery )

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

  • A Computer running GNU/Linux, 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 Samsung 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)

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 )

.

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 )

**there are many /partitions on the phone (depending of the device model), but the install process will only modify /recovery and /system,

NOT ALL THE SAMSUNG FIRMWARE**

if you want to learn more about Samsung Hardware you can read this post

.

2) Download TWRP.img

On your PC,

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

twrp version 3.4.x-x and 3.5.x-x are designed for android (Q 10), (R 11),

don’t choose it

for installing /e/ android (nougat 7), (oreo 8), (pie 9), download an older version like 3.3.x-x

.

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 (optional)

$ sudo apt install heimdall-flash

$ sudo apt install heimdall-flash-frontend (optional)

  • or

$ sudo apt-get update

$ sudo apt-get upgrade

$ sudo apt-get install android-tools-adb

$ sudo apt-get install android-tools-fastboot (optional)

$ sudo apt-get install heimdall-flash

$ sudo apt-get install heimdall-flash-frontend (optional)

  • 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 :

  • adb

      • cd

wget https://dl.google.com/android/repository/platform-tools-latest-linux.zip

unzip platform-tools-latest-linux.zip

echo ’

if [ -d “$HOME/adb-fastboot/platform-tools” ] ; then

export PATH=“$HOME/adb-fastboot/platform-tools:$PATH”

fi

’ >> ~/.bash_profile

. ~/.bash_profile

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 :

in android 5 lollipop

in android 4 jelly bean :

  • 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.

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

  • In Developer options allow USB debugging under DEBUGGING

in android 5 Lollipop

  • There is a disclamer :

  • Tap OK to Allow USB debugging and enable it.

  • Connect your smartphone using USB cable to GNU/Linux PC to whitelist USB debugging from it to unlock bootloader .

  • There is a disclamer :

  • 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.

  • 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 instead.

  • 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.

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

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

  • In Developer options enable USB debugging under DEBUGGING

  • There is a disclamer :

  • Tap OK to Allow USB debugging and enable it.

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

There is a disclamer :

  • 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.

  • 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

…IT IS THE CRUTIAL STEP !..

  • 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…

…IT WAS THE CRUTIAL STEP !..

You must see the TWRP flash logo,

and the welcome screen :

if you see something like that :

It FAILED, this is the Official Stock Vendor Samsung / Gogol Firmware Recovery screen !

Please re-read and retry the flashing process of TWRP.

.

6.1) ( only for the Galaxy s9 )

Additional step : Patch the device

  1. Download the patch from here

  2. Install the patch

  3. On the device, go into

Advanced > ADB Sideload,

then swipe to begin sideload

  1. From the computer, please run

adb sideload no-verity-opt-encrypt-samsung-1.0.zip

.

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

  • —i> Swipe to Allow Modifications

this is the TWRP main menu

  • Tap Wipe from Main Menu.

image

  • Tap Format Data therein to continue.

  • Type yes in the text field to continue.

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

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

  • and tap recovery

image

  • unselect “prompt to install TWRP app…”

and “install as a System app”,

  • tap on “do not install”.

the device reboot to TWRP

  • From the main menu, choose wipe,

image

and tap Advanced Wipe .

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

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

  • tap back to the main menu

  • choose Advanced

  • Tap ADB Sideload

image

  • Select Wipe Dalvik Cache and Wipe Cache

  • then Swipe to Start ADB Sideload

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.

  • Tap Reboot System

  • wait several minutes…

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

  • Voila! Easy, isn’t it?

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,

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)

  • Tap Wipe from Main Menu.

image

  • Tap Format Data

  • Type yes in the text field to continue.

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

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

  • and tap recovery

the device reboot to TWRP

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

image

and tap Advanced Wipe .

  1. Select the following items to delete and nothing else :
  • Dalvik / ART Cache

  • Data

  • Internal Storage

  • cache

  • system

  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.

  1. 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”).

  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).

  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”.

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

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

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

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.

  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.

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

12 Likes
1 Like

Wow, really cool man. Linux a block a la maison (Manjaro!) Merci, Nico

Merci, je n’arrivais pas à l’installer sur mon Xiaomi Mi9t Pro (M1903F11G).
Grâce au tuto, impeccable.
Merci

Thank you, I could not install it on my Xiaomi Mi9t Pro (M1903F11G).
Thanks to the tutorial, perfect.
Thank you

1 Like

I recommend to use SD card. Putting file on SD card and uploading from there is sure way to do at first round. Adb failed me a few times and worked a few times, depending on the cable, phone’s internal state, cosmic explosions stellar years away and other invisible influences.

And a great guide, btw. Very detailed, step by step.

2 Likes

Hello everyone.

I have this famous error 7:

Updater process ended with error: 7

This package required firmware from an Android 10 based MIUI build. Please upgrade firmware and retry!

What I have already tried :

  • Redo the manipulation 3x
  • Download an older image twrp-3.3.1-0-raphael.img instead of twrp-3.6.1_9-0-raphael.img
  • Change the name of the zip e-0.14-q-20201224-UNOFFICIAL-raphael.zip to filename.zip

Nothing happens, I still have the same error 7 for Android 10. Any idea?

Thanks a lot, I keep smiling :smiley:

  • In TWRP, go to ->Wipe ->Advanced Wipe, (select /data) ->Repair or Change File System ->Change File System ->FAT
  • return back to the main menu, and choose reboot to recovery.
  • go to ->Wipe ->Advanced Wipe, (select /data) ->Repair or Change File System ->Change File System ->EXT4
  • return back to the main menu, and choose reboot to recovery

THEN install /e/

.

Merci @piero :slight_smile:

I followed your tutorial, then I restarted ADB sideload but I still get the same error. And I’m on version twrp-3.3.1-0-raphael.img by the way. I don’t know if I should redo the whole protocol with the latest version or not.

Are you running latest Xiaomi firmware ?

I don’t know. I have made the major updates but, since I plan to switch to /e /os, I haven’t done the updates. So if there was a major update in the last 3 weeks, I must not have done it.

I can do it right now with the global MAJ. But recovery or fastboot? I can install it through TWRP?

Sorry, i don’t know xiaomi but you must not running Android 11 as a base to install e-q-unofficial, but Android 10

How can I know the version of Android installed?

I can see this two possibilities:

  • |Mi 9T Pro Global|Stable|Recovery|V12.0.6.0.QFKMIXM|10.0|2.5 GB|2021-06-12|
  • |Mi 9T Pro Global|Stable|Fastboot|V12.0.6.0.QFKMIXM|10.0|3.0 GB|2021-06-10|

PS : si tu es du côté de Pau, fais signe :slight_smile:

In settings ->about the phone

I can’t reboot on the Xiaomi OS right now I think. All I can do is fastboot ou recovery.

I found a screenshot sent and so, mid January 2022, I was already on Android 11.

So I need a downgrade of the firmware, isn’t it?

1 Like

https://community.e.foundation/search?q=Xiaomi%20tool%20linux

.

.

https://forum.xda-developers.com/t/tool-linux-miflash-for-linux.3708847/

.

https://forum.xda-developers.com/t/guide-how-to-properly-use-the-sp-flash-tool-for-merlin-redmi-note-9-redmi-10x-4g.4229937/

.

https://xiaomifirmwareupdater.com/miui/raphael/

Nice documentation job, i used it to reflash my galaxy s10+ device.
Made it with the file on my sd-card. the adb side-load had (some issue on my desktop).
Got a zip signature problem, but as i checked the sha256sum i decided to deactivate the zip signature check function.
And it did the job…

1 Like

I saw that it’s possible to downgrade to Android 10 by cheating with the system as shown here Xiaomi Poco X3 Pro | Downgrade MIUI 12.5 to MIUI 12 | Locked Bootloader | NO TWRP | Without Computer - Invidious

Next step for me :sunny:

Hello everyone.

I have not been able to solve this error 7 :roll_eyes:

I have tried:

  • To disable the PIN code
  • To have a PIN code without a pattern
  • Repair the /data partition via TWRP
  • Change the file system of the /data partition via TWRP to EXT2 then EXT4: data loss, corrupted partition :rage:

But I still managed without a backup [Unofficial Build] Xiaomi Redmi K20 Pro Mi9T Pro raphael e-OS Q-build - #30 by Parhit

Thanks to everyone :sunny:

On the subject of Linux Flashing tools:

odin4 for linux

Is there any way to perhaps use this?