Recover Android system with TWRP Recovery Note that I am running Mac OS X.




I tried installing an unofficial version of Cyanogenmod I found on XDA Developers that supports kltemini (SM-G800F). However, I messed up somewhere in the installation, and got a message on TWRP recovery saying:

Can't install this package on top of incompatible data. Please try another package or run a factory reset


And when I try pressing Reboot into System, I get:

No OS Installed! Are you sure you wish to reboot?


In the comments, @beeshyams said that I can install from a trusted source SamMobile, where I did get the SM-G800F Czech version, and downloaded it. However, the flashing fails with:

Error flashing zip /external_sd/Android_Stock.zip


Extracting it on a computer makes a .tar.md5 file, and extracting that gives me a bunch of .img files. I read that I should compress these, and flash, but the same error showed.

Another solution could be to download a custom ROM so I can actually boot into ANYTHING, but most ROMs don't support SM-G800F.

What I can also do is go to Download mode, and download stock recovery, so I can re-install the OS over OTA, however there is a risk that I will not be able to use Recovery anymore.

How can I solve this?



UPDATE:

Trying to flash stock recovery with heimdall prints:

ERROR: Failed to send data!
Releasing device interface...


I am on OS X and I am using the CLI Heimdall to flash



I also made a chatroom for active discussion here: http://chat.stackexchange.com/rooms/33331/discussion-on-question
Looking at the installation instructions of the ROM you flashed, I am guessing in the TWRP/ CWM options, under Advanced Wipe , one of the options " Wipe Dalvik Cache, Cache, System and Data " (likely data) was missed out leading to the current situation.

[[ Edit

Thanks to OP for confirming that wiping data was missed out by him while installing CM. A couple of other observations made by OP are listed. These are NOT normally observed behaviour of CWM but may be occurring due to incompatibilities of ROM being " unofficial"


CM didn't start normally when data partition alone was backed up
He had to resort to wiping data to get back to normal functioning. This is also mentioned in the installation instructions of the ROM



  Flash CyanogenMod:....Note that the recovery might fail to restore the backup when you want to go back to the stock ROM (emphasis by ROM developer)


]]

That aside, as you brought out, there are two options

Option 1 Re-flash CM ROM and subsequently revert to stock if needed

Option 2 Attempt to flash stock directly

Option 1 would be preferred option since your unable to flash stock ROM and get an error message

Suggested steps for Option 1


Boot to recovery mode of TWRP/CWM
Wipe Dalvik Cache, Cache, and Data (inside Wipe -> Advanced Wipe for TWRP)
Install CM ROM
Install the GApps zip-package
Test that ROM is correctly installed by testing minimum functionality of Google play store connecting, camera and call/ SMS working


Now,assuming it is successful,use the ROM for a couple of days before deciding if you want to continue with it or revert to stock

Reverting to Stock from CM 12


Since you are using OS X and Debian, install Heimdall (am not conversant with it so will skip the details)
Flash recovery. This guide seems to explain the process well but you can suggest a better alternative with your experience http://davideddu.org/blog/posts/how-to-flash-a-recovery-image-using-heimdall/





  Additional Information that may come in handy for related issues and also to cover points raised in the comments section of question


Windows users:


Flashing Stock using Odin


Odin has different versions and some of the versions have options changed. Hence, the description in guides may differ with options available on the tool. This guide has a good pictorial description corresponding to newer version of Odin 

http://androidmtk.com/flash-samsung-stock-rom-using-odin


Extracting Stock recovery from stock image

http://howto.highonandroid.com/samsung-tutorials/how-to-extract-stock-recovery-from-samsung-firmware/2/
Linux users 


Instructions for flashing stock ROM ate covered here How to convert .img to .tar to flash using Samsung odin tool?


Command line instructions for backing up stock recovery from image
Can we backup the stock recovery.img in any way?