[Galaxy S 5 General] xbartolo:
This thread is how I have managed to upgrade a Samsung S5 with Android 6.01 to LineageOS 16 with a Mac laptop running Sierra, in an attempt to keep on using it with my car infortaintment system.

First of all it's important to leave very clear 2 things:

ALL THIS INSTRUCTIONS APPLY TO A SAMSUNG S5 SM-G900F kltexx device. I don't know how it will work in any other device . This is what has worked for me and I'm sharing this with you all just hoping that will be useful for someone else.

YOU ARE THE SOLE RESPONSIBLE FOR ANYTHING THAT MIGHT HAPPEN TO YOUR DEVICE.

So let's get started.

Prepare your system:

You must have the Samsung USB drivers installed (I used the latest ones from Samsung - https://developer.samsung.com/mobile/android-usb-driver.html).

You need to allow your device to debug it using the USB. Instructions here: https://androidcure.com/enable-usb-debugging-samsung-galaxy-s5/

You need to install adb in your computer. The easiest way to do it is this one: https://www.cyanogenmods.org/minimal-adb-and-fastboot-windows/ although another option would be to install Android SDK platform tools, but thats much heavier (https://developer.android.com/studio/releases/platform-tools). Usually the first option is enough.

You need to ensure that your Samsung will always trust your computer. So connect your Samsung with your computer and when it asks if your computer can be trusted, make sure that you click on the checkbox with the option "Always".

ODIN:

You need to install a Recovery System in your device and for that you will need ODIN which is a tool created by Samsung to flash files to Samsung devices. It has a version for Mac which has worked for me. Go to this site to learn how to use it and to download it: https://macmetric.com/odin-for-mac/ or you can right jump to this site (https://xdaforums.com/devdb/project/dl/?id=20803) to just download the version that worked for me.

ROOT : (Optional)

By default your device has the bootloader unlocked. This was something that drove me crazy as I couldn't find anywhere to show me if it was. I ended up rooting my device to confirm that it was unlocked and also to confirm the real name of my device. So it's almost 100% certain that your Samsung S5 has the bootloader unlocked, but in case you want to confirm it, as I did, follow the instructions from this thread https://xdaforums.com/showthread.php?t=2696537.

Basically, I ended up on this page, CF-Auto-Root homepage

http://autoroot.chainfire.eu/ downloading the file to root my device from there and flashing it with JOdin. Keep in mind that you might think that your device is version klte and there are at least 5 klte: kltedx, kltexx, kltezh, klteduosxx and kltejv. Mine ended up being kltexx ;)

In my case I followed the process described in that thread and tried to root my device with the file for kltedx and it didn't wok out. Then I tried again with the file for kltexx and it worked. That's how I discovered that mine was kltexx.

TWRP :

You need to install a custom recovery system to your Samsung S5 device to be able to flash the LineageOS ROM. This site has the instructions that I followed to install it: https://www.cyanogenmods.org/forums/topic/install-twrp-recovery-samsung-android-using-odin/

It is extremely important to highlight that the latest version of TWRP didn't work for me. I installed the latest one and everything seemed to be OK but it was not. I couldn't flash any ROM with it. I ended up discovering that for my case, the best option was to install an older version. To be more precise, version 3.0.2.2 (https://eu.dl.twrp.me/klte/twrp-3.0.2-2-klte.img.tar.html).

To make sure that you have been able to install TWRP do the following. There are 3 ways to boot your Samsung S5: Normal boot, Download mode (ODIN) and Recovery mode. We need to start up on recovery Mode and see a screen menu similar to the one we've seen in the previous thread (https://www.cyanogenmods.org/forums/topic/install-twrp-recovery-samsung-android-using-odin/).

To do so, start the device on Recovery mode:

For the Normal mode you just click the Power Up key and wait. No magic here.

For the Download mode you have to switch off your device and then click at the same time the Power Up key, the Volumen Down key and Home key. It comes with the standard installation, so no magic here either.

Home Key

For the Recovery mode, you have to switch off your device and then click at the same time Power Up key, Volumen Up key and Home key. After a couple of seconds, the screen will say at the top "Recovery option..." and you should be able to see the touch screen menu of TWRP.

Flashing LineageOS 16 :

This is suppose to be an easy step but it ended up being very complicated because my device name was not properly being exposed by my device. So I ended up modifying the installation script to ensure it didn't matter.

So, you have to download not only the LineageOS version but also some other packages like Google apps, that are not installed and that you will need, and also the rooting package, which is always handy.

So the instructions and the links to download the packages are here. You might go there, read them and download all the packages: https://wiki.lineageos.org/devices/klte/install under the section Installing from Recovery....

Once you have all the packages ready to install, before you follow their instructions, you will have to do some hacking that you will find here explained here: http://www.lineageosdownloads.com/fix-error-7-lineage-os/ under section METHOD 1: UPDATER SCRIPT HACK TO FIX ERROR 7.

Basically, what I did was to edit the zip file using vim editor from the command line. You type "vim lineage-16.0-20200726-nightly-klte-signed.zip" (being lineage-16.0-20200726-nightly-klte-signed.zipand the name of the lineageOS image) and then go to "META-INF/com/google/android/updater-script" and then edit the file removing all the lines where it has any reference to the device name which are usually the first lines of the script containing the getprop(...) lines of code. To remove them, just click "dd" and they will be removed. Once they are removed, click on "Esc". Then type ":wq", it will go back to the previous screen, and then click ":q" and taht will be it, you have the package ready to be installed.

Now follow the instructions that you read previously and you should be able to have your Samsung S5 updated to LineageOS 16.

And now comes the part that I haven't resolved yet. How to install Mirrorlink in this device. So far I have managed to get several version of the Driverlink APK from Samsung but I'm not able to install them because when I try to do it using adb in root mode, I get the following message: "Package com.sec.android.automotive.drivelink has no signatures that match those in shared user android.uid.phone; ignoring!".

I know it has something to do with the signatures of LineageOS and that I need to sign the APK file with the LineageOS ROM signatures, but so far I haven't been able to find how to do it.

So I'll keep on trying and posting my discoveries here. Anyway, if anyone is willing to help me, it will be very welcome!!

I really hope that this helps others to take back from the closet their forgotten Samsung S5 and put it back to work.