A complete step-by-step guide to flashing Samsung firmware using Linux and the open-source Odin alternative: Heimdall.
- A Samsung smartphone or tablet
- A Linux distro (tested on Ubuntu 24.04)
- A USB cable (preferably original)
- Downloaded Samsung firmware (from SamMobile, SamFW, etc.)
heimdallinstalled
Install via APT:
sudo apt update
sudo apt install heimdall-flashVerify installation:
heimdall versionIf you get APT lock errors (e.g., packagekitd holding lock), run:
sudo killall packagekitdUse one of these combinations (device dependent):
| Device Type | Button Combo |
|---|---|
| Older (w/ Bixby) | Vol Down + Bixby + Power |
| Newer (no Bixby) | Vol Down + Vol Up (then connect USB) |
| One UI 6+ Devices | Vol Down + Vol Up + USB cable |
Then press Vol Up to enter Download Mode.
Connect your device via USB and run:
sudo heimdall detectExpected output:
Device detected
If not, check:
- USB cable/port
- USB debugging / driver issues
- That you're really in Download Mode
Extract .tar.md5 firmware:
7z x firmware.tar.md5This should give you .img files like:
boot.imgrecovery.imgvbmeta.imgsuper.imguserdata.img
You do not flash
.tar.md5directly with Heimdall.
Get the PIT (Partition Information Table):
sudo heimdall print-pitExample partitions:
BOOTRECOVERYSUPERVBMETA
β οΈ Many modern Samsung devices do not have aSYSTEMpartition β useSUPERinstead.
Flash the files to correct partitions:
sudo heimdall flash \
--BOOT boot.img \
--RECOVERY recovery.img \
--SUPER super.img \
--VBMETA vbmeta.imgCustomize flags based on what you extracted and what print-pit showed.
If the device doesnβt reboot automatically:
sudo heimdall rebootecho 'SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666"' | sudo tee /etc/udev/rules.d/50-samsung.rules
sudo udevadm control --reload-rulesUnplug and replug your device afterward.
Youβve successfully flashed your Samsung firmware from Linux. π This method is especially useful for developers or users who donβt want to rely on Windows-only tools like Odin.
- Only flash firmware exactly matching your model number
- Back up your data β flashing usually wipes the device
- Be cautious β improper flashing can brick your device
- Heimdall Project: https://github.com/Benjamin-Dobell/Heimdall
- Samsung Firmware: https://samfw.com/ or https://www.sammobile.com/
heimdall is not working for recovery.img for samsung s6 lite(wifi), shows 'ERROR: Failed to receive session end confirmation!' this error and tab says only official binaries can be flashed.