Linux: Extract the Heimdall suite zip and take note of the new directory containing heimdall. Now copy heimdall into a directory in $PATH, a common one on most distros will be /usr/local/bin. For example cp heimdall /usr/local/bin. You can verify Heimdall is functioning by opening a Terminal and running heimdall version.
Assistant
Certainly! Here's a clear, step-by-step guide to install Heimdall on Linux as you described:
How to Install Heimdall on Linux
1. Download the Heimdall Suite ZIP
First, get the Heimdall Suite ZIP archive from the official source (e.g., Heimdall GitHub releases).
2. Extract the ZIP File
Open a terminal, then navigate to the directory where you downloaded the ZIP file and extract it. For example:
unzip Heimdall.Suite.<version>.zip
After extracting, you will see a new directory with the extracted files, which contains the heimdall binary.
3. Copy the Heimdall Binary to a Directory in Your $PATH
A common path to install executables globally is . You need superuser permissions to copy files there:
User
Tip: Normally, adb will report Total xfer: 1.00x, but in some cases, even if the process succeeds the output will stop at 47% and report adb: failed to read command: Success. In some cases it will report adb: failed to read command: No error or adb: failed to read command: Undefined error: 0 which is also fine.
Assistant
Thanks for the tip! Here's a clearer explanation about the adb transfer messages and what they mean when flashing or transferring files during Android device operations:
Understanding adb Transfer Messages and "failed to read command" Warnings
When using adb (Android Debug Bridge) to send files or commands to your device — for example when pushing files, sideloading OTA updates, or flashing images — you might see output like:
User
how to install lineage-22.2 in samsung a21s
Assistant
User
anther whet
Assistant
It looks like you want another method or an alternative way to install LineageOS 22.2 on your Samsung Galaxy A21s. Here’s a slightly different, simplified approach focusing on the basics and using common tools:
Copyright (c) 2010-2017 Benjamin Dobell, Glass Echidna https://glassechidna.com.au
Copyright (c) 2021-2024 Henrik Grimler
This software is provided free of charge. Copying and redistribution is encouraged.
Ending session...
ERROR: Failed to receive session end confirmation!
Releasing device interface...
Assistant
The error message:
ERROR: Failed to receive session end confirmation!
after a seemingly successful Heimdall flash is a common issue and usually does not indicate a failed flash. Here's what it means and what you can do:
Explanation
Heimdall finished uploading your recovery image successfully:
RECOVERY upload successful
The error occurs when Heimdall waits for confirmation from the device that the flash session has ended, but the device doesn’t send this confirmation (sometimes due to device rebooting or USB connection reset).
User
install it
Assistant
To install the recovery image on your Samsung Galaxy A21s using Heimdall on Linux, follow these clear step-by-step instructions:
Step-by-step: Flash Recovery with Heimdall and Boot into It
User
with adb
Assistant
Absolutely! Here’s how to install LineageOS 22.2 on your Samsung Galaxy A21s using adb and TWRP recovery, step-by-step:
Pre-requisites
Phone with unlocked bootloader and TWRP recovery installed (flashed via Heimdall/Odin or other method).
Your partitions (BOOT, DTBO, VBMETA, RECOVERY) have been successfully flashed.
The ERROR: Failed to receive session end confirmation! is a known benign Heimdall quirk that usually doesn't indicate a problem with flashing.
The key thing now is to manually boot into recovery immediately to prevent stock recovery from replacing your flashed recovery.
What to do next:
Disconnect USB cable.
On your Samsung Galaxy A21s, hold Volume Up + Power + Home/Bixby buttons simultaneously right after flashing until the custom recovery (TWRP) screen appears.
If TWRP recovery loads, the flash succeeded.
After booting into recovery:
User
antix@Antix:~/Downloadsadbsi
Assistant
Great! The message:
Total xfer: 1.00x
means the adb sideload completed successfully.
What to do next:
On your phone (currently in TWRP recovery), go to the main menu and tap:
Reboot → System
The first boot after LineageOS installation may take several minutes, so be patient.
Optional next steps (if you want Google apps):
If you plan to install GApps, you can now sideload the GApps package ZIP similarly:
adb sideload open_gapps-arm64-13.0-pico.zip
Then reboot system again.
If you encounter issues:
Boot back to TWRP
Try wiping Cache and Dalvik/ART Cache
Then reboot system again.
Congratulations! You’ve successfully installed LineageOS 22.2 on your Samsung Galaxy A21s.
If you want help with post-install setup or troubleshooting, just ask!
User
no it not workes
Assistant
User
antix@Antix:~/Downloads$ adb devices
List of devices attached
R58R415DC0Y device
antix@Antix:~/Downloads$
Assistant
Thanks for sharing that. Your device is listed as R58R415DC0Y device — which means adb sees your device in normal mode, not in sideload mode.
This explains why the adb sideload command didn’t actually start — your phone was not in sideload mode.
Here’s how to properly get into sideload mode and flash the ROM step-by-step:
1. Boot into TWRP and enter sideload mode
Power off your Galaxy A21s.
Boot into recovery:
Hold Volume Up + Power + Home/Bixby simultaneously until TWRP loads.
In TWRP main screen, tap Advanced > ADB Sideload.
Swipe the slider to start sideload mode.
User
twarp not load
Assistant
User
antix@Antix:~/Downloads$ adb devices
List of devices attached
R58R415DC0Y device
antix@Antix:/Downloadsad adb sideload lineage-22.2-20250520-nightly-a21s-signed.zip
Total xfer: 1.00x
antix@Antix:/Downloads$ adb devices
List of devices attached
R58R415DC0Y device
Copyright (c) 2010-2017 Benjamin Dobell, Glass Echidna https://glassechidna.com.au
Copyright (c) 2021-2024 Henrik Grimler
This software is provided free of charge. Copying and redistribution is encouraged.
Unlock the Bootloader:
You need to unlock the bootloader on your Samsung Galaxy A21s. This step will wipe all data on your device.
Install a Custom Recovery:
You will need to install a custom recovery like TWRP to flash LineageOS.
Backup your data:
Unlocking the bootloader and flashing a new ROM wipes all user data. Backup your important files.
Charge your device:
Ensure your phone is at least 50-60% charged.
Download necessary files:
Latest LineageOS build for Galaxy A21s
Corresponding Google Apps (GApps) package, if you want Google services
Latest TWRP recovery image or installer for Galaxy A21s
Odin tool (on PC for flashing)
Step-By-Step Installation Process
Step 1: Unlock Bootloader
Go to Settings > About phone > Software information.
Tap Build number 7 times to enable Developer Options.
Go back to Settings, open Developer Options.
Enable OEM Unlocking and USB Debugging.
Power off the phone.
Boot into Download Mode (Hold Volume Down + Power + Home/Bixby button, then press Volume Up to confirm).
Connect phone to PC and use Odin tool to unlock the bootloader or follow Samsung official unlock method.
(Unlocking bootloader varies by region, some carriers; check specific regional instructions.)
Note: Unlocking the bootloader will erase all data.
Step 2: Install TWRP Custom Recovery
Download the latest TWRP .tar file for Galaxy A21s.
Reboot device into Download Mode again.
Open Odin on PC, connect phone via USB.
In Odin, under AP section, select the TWRP .tar file.
Disable Auto Reboot in Odin’s options.
Click Start to flash TWRP.
Once done, manually boot into recovery:
Immediately press and hold Volume Up + Power buttons simultaneously to boot into TWRP and prevent bootloader from restoring stock recovery.
Step 3: Wipe Data and Prepare for ROM Installation
In TWRP, take a Nandroid Backup of your current ROM if desired.
Go to Wipe > Advanced Wipe and select:
Dalvik / ART Cache
Cache
Data
System
Swipe to wipe.
Step 4: Flash LineageOS and GApps (Optional)
Transfer the LineageOS .zip file and GApps .zip file via USB or external storage.
In TWRP go to Install.
Select the LineageOS .zip and swipe to flash.
After flashing LineageOS, flash the GApps package similarly if you want Google services.
Optionally, flash any Magisk or root package if desired.
Step 5: Reboot
After flashing, go back to main menu and select Reboot > System.
TWRP recovery for your device (download latest from TWRP official site or from trusted source for A21s)
Heimdall or Odin tool installed on your PC
Step 1: Unlock the Bootloader
Unlocking the bootloader will erase all data.
On your phone, go to: Settings > About phone > Software information
Tap Build number 7 times till Developer options enabled.
Back to: Settings > Developer options
Enable:
OEM unlocking
USB debugging
Power off your phone.
Boot into Download Mode:
Press and hold Volume Down + Power + Home (or Bixby) button simultaneously.
Press Volume Up to confirm entry.
Connect your phone to PC.
Use Odin (Windows) or Heimdall (Linux/macOS) to unlock bootloader if needed (sometimes bootloader unlock is completed inside device once OEM unlocking enabled — the exact method depends on region/carrier). Refer to Samsung’s official documentation or trusted region-specific tutorials for unlocking Samsung bootloader.
Step 2: Flash TWRP Custom Recovery
Download the TWRP .tar file for Galaxy A21s.
Boot your phone into Download Mode (Volume Down + Power + Home/Bixby), connect to PC.
Open Odin on Windows or Heimdall on Linux/macOS.
In Odin:
Click AP and select the TWRP .tar file.
Make sure Auto Reboot is unchecked.
Click Start to flash TWRP.
After flashing, do not let the phone reboot normally. Reboot immediately into recovery:
Hold Volume Up + Power + Home/Bixby buttons until TWRP loads.
(This prevents stock recovery from overwriting TWRP)
Step 3: Wipe and Prepare Partitions in TWRP
In TWRP, go to: Wipe > Advanced Wipe
Select:
Dalvik / ART Cache
Cache
System
Data
Swipe to wipe.
Step 4: Install LineageOS 22.2
Transfer the LineageOS 22.2 .zip file (and optionally GApps .zip) to your phone via USB or external storage.
In TWRP: Install > select LineageOS .zip > swipe to flash.
If you want Google apps, flash the GApps .zip next in the same way.
Optionally flash Magisk for root (latest Magisk .zip).
Step 5: Reboot System
Return to TWRP main menu.
Tap Reboot > System.
First boot takes a few minutes; be patient.
Additional Tips
After flashing LineageOS, you may want to disable automatic updates until you confirm everything works.
If you encounter boot loops or errors, boot back into TWRP and flash again or restore backup.
For detailed Galaxy A21s specific bootloader unlocking and recovery flashing nuances, consult device-specific forums like XDA.
If you'd like, I can help with specific download links or more detailed commands for Heimdall/Odin flashing!
Alternative Method to Install LineageOS 22.2 on Samsung Galaxy A21s
Requirements:
Samsung Galaxy A21s
USB cable and PC (Windows preferred for Odin)
Backup of your data
USB debugging and OEM unlocking enabled (Settings > Developer options)
Download the following:
Odin tool (Windows)
TWRP recovery .tar for A21s
LineageOS 22.2 ZIP for A21s
GApps ZIP (optional)
Charge your phone to >50%
Step 1: Unlock the Bootloader
Enable OEM unlocking and USB debugging as above.
Boot into Download Mode (Vol Down + Power + Home/Bixby buttons).
Connect to PC and unlock bootloader using Odin or Samsung’s official tool if required.
Note: Unlocking the bootloader wipes all data.
Step 2: Flash TWRP Recovery with Odin
Open Odin on your Windows PC.
Connect your phone (in Download Mode).
Load the TWRP .tar file into the AP slot in Odin.
Make sure Auto Reboot is unchecked.
Click Start to flash TWRP.
After completion, hold Volume Up + Power + Home/Bixby immediately to boot into TWRP (do not let it reboot normally).
Step 3: Wipe Factory Reset in TWRP
Go to Wipe > Advanced Wipe and select Dalvik / ART Cache, Cache, Data, and System.
Swipe to wipe these partitions.
Step 4: Flash LineageOS and GApps
Transfer LineageOS 22.2 ZIP (and GApps ZIP if needed) to the device.
In TWRP, tap Install.
Select LineageOS ZIP and swipe to install.
Flash GApps ZIP right after if you want Google services.
(Optional) Flash Magisk for root.
Step 5: Reboot
From TWRP, go to Reboot > System.
Wait several minutes for the first boot.
Notes
If you encounter bootloops, re-enter TWRP and wipe cache & dalvik again.
Double-check device-specific instructions and ROM versions to avoid incompatibility.
Always keep a backup!
If you want me to provide exact download links or detailed Odin usage commands or Linux Heimdall commands, just let me know!
Despite this message, the flash normally works correctly.
What To Do Next
Manually boot into recovery immediately (before letting the device reboot to the system or stock recovery):
After flashing TWRP or any custom recovery, hold Volume Up + Power + Home/Bixby buttons to boot into recovery mode.
This prevents Samsung’s stock recovery from overwriting your custom recovery.
Check if the recovery was flashed properly by booting into recovery:
If TWRP (or your custom recovery) loads, the flash succeeded despite the Heimdall message.
If the device boots normally to stock/system or stock recovery:
Try flashing again.
Make sure to boot immediately into recovery after Heimdall finishes flashing.
Optional: Use --no-reboot (which you already did)
You did the right thing by adding --no-reboot — it means Heimdall won’t reboot the device immediately, so you can manually boot into recovery.
Summary
The flash likely succeeded successfully despite the session end error.
Immediately boot into recovery mode manually.
Ignore the "Failed to receive session end confirmation" unless the image definitely did not flash.
If you want, I can help with the exact commands or troubleshooting next steps. Just ask!
Prerequisites:
Heimdall installed and working on your Linux PC.
Recovery image file, e.g., recovery.img (TWRP or other custom recovery).
USB debugging enabled on phone.
Phone in Download Mode (Power off, then hold Volume Down + Power + Home/Bixby, then press Volume Up to confirm).
USB cable and PC connection.
Step 1: Connect device in Download Mode and flash recovery
Run this command in your terminal, from the directory where recovery.img is located:
Note: If Heimdall complains about certain partitions (e.g., super_empty.img), skip them or flash those separately if needed (super_empty.img usually corresponds to the "super" partition but is often not needed to be flashed directly unless instructed).
Important: Use --no-reboot so that device does not reboot automatically after flashing and you can boot into recovery immediately.
Copyright (c) 2010-2017 Benjamin Dobell, Glass Echidna https://glassechidna.com.au
Copyright (c) 2021-2024 Henrik Grimler
This software is provided free of charge. Copying and redistribution is encouraged.
You have flashed the critical partitions successfully. Now just:
Boot manually into recovery (Volume Up + Power + Home/Bixby)
Use adb sideload to flash LineageOS ZIP
Reboot and enjoy LineageOS!
If you want instructions on wiping or sideloading step-by-step, just ask!
d
e
l
o
a
d
l
in
e
a
g
e
−
22.2−
20250520−
nightly−
a21s−
signed.zipTotalxfer:
1.00xantix@Antix:/Downloads
Got it — since the adb sideload terminated very quickly with just Total xfer: 1.00x and you say it did not work (i.e., LineageOS didn’t install or boot properly), let's troubleshoot and fix this step by step.
What probably happened
The sideload transferred only a tiny fraction or didn't actually flash the ROM.
Sometimes the adb sideload command finishes quickly if it doesn't find the device properly in sideload mode.
Or the device returned to recovery main menu or failed installation silently.
Step-by-step Troubleshooting and Installation
1) Verify your device is properly in adb sideload mode
Reboot into TWRP recovery using buttons (Vol Up + Power + Home/Bixby).
Once in TWRP main screen, tap Advanced > ADB Sideload.
Swipe to start sideload mode on the device.
Now, on your PC terminal, run:
adb devices
You should see a device listed with sideload next to it, for example:
123456789ABCDEF sideload
If not, your device is not in sideload mode, and sideload won't work.
2) Run adb sideload command again
With device in sideload mode and showing in adb devices as sideload:
Copyright (c) 2010-2017 Benjamin Dobell, Glass Echidna https://glassechidna.com.au
Copyright (c) 2021-2024 Henrik Grimler
This software is provided free of charge. Copying and redistribution is encouraged.