How to install Ubuntu Touch on Nexus 5 if previously installed a custom rom
-
So this problem gave me a lot of headaches. Maybe this post will save time for others.
In order to be able to install Ubuntu Touch using the UB Ports installer, you have to start from stock Android (https://developers.google.com/android/images#hammerhead).
Normally, all you have to do is to download the latest firware for Nexus 5 from the link above (Android 6), extract on the desktop running Windows its contents and doubleclick on flash-all (Windows Batch File).
However, if you have previously installed newer custom roms, such as Unofficial LineageOS based on Android 11(https://forum.xda-developers.com/t/rom-unofficial-lineageos-18-1-for-nexus-5-hammerhead-discontinued.4214367/), you may need to revert back to the stock partitioning.
Information can be found here: https://forum.xda-developers.com/t/recovery-unofficial-twrp-hh-for-nexus-5-hammerhead-discontinued.4047653/
In this case, when I installed this custom rom I had to use a special customized TWRP, namely TWRP HH.R.
In order to install Ubuntu Touch in this case I had to revert to the stock partitioning, please see at the link above:
``How to revert back to stock /system size and stock partitions map:- Launch HH.R version of TWRP
- Open terminal (TWRP -> Advanced -> Terminal)
- Type hh_repart -r
- Wait until your phone reboots
- Flash official TWRP or HH.S version of TWRP! Don't ignore this step!``
Afterwards, I installed the stock rom as described above and the UB Ports worked perfectly.
-
-
@bzzz Indeed.
There's also an easier method available when using a Windows PC: Download "Nexus root toolkit".
This software has an easy GUI for people who are not very familiar with the technique. You can easily revert back to the latest original stock rom, then can proceed to install Ubuntu Touch with the UBports installer. -
@stanwood It does work, but if a custom ROM has been used, the partitions are not altered by reinstalling the stock ROM so UT won't install. It took me a couple of goes to work this out and use the hh_repartition zip to get the partitions back to stock. I learnt a lot repairing the Nexus 4 and 5 hardware wise, but also a lot about repairing the ROM and ultimately installing UT.