The short answer is: You can't.
The iPhone is made of proprietary hardware and software. The biggest issue is getting iboot to boot another OS. There was once a project (I think is gone now, due to developers unable to get it to work) to get Android to run on the iPhone. If android can run, then the next step is to get CyanogenMod to work. Apple provides little documentation on the hardware, for developer to write third party drivers, so it is just close to impossible to get it to work. Hypothetically, if you could get Linux to run, then Ubuntu Touch will be fine, but Apple does not want you to do so. Thus it will be impossible to get everything working. It will be too much work, and besides, it is cheaper (not to mention simpler) to get Android phones to run Ubuntu Touch.
Long winded, but hope that answered it.
The old project was called
idroidproject. The biggest problem for the developer was having to rewrite all the drivers for the iPhone to work on Android. He did manage to get an old version of it to run on the iPhone 1g and iPod Touch 1g, but all the other devices were not working. Looks like their domain went offline, so the project is officially dead. Here is the github page: https://github.com/iDroid-Project/openiBoot