My setup:

Laptop with Ubuntu 14.04LTS  and Nexus 4.

I also assume you are comfortable with the command prompt. You need to run some commands from terminal.

If you are already running Android 5.0, you can skip Step 1 and go directly to Step 2 to root your device. In my case, I didn’t wait for the OTA update, but if you prefer to play it safe, get the Android 5.0 update and then start.

Pre-Preparation.

Make sure your laptop is charged or plugged into the power and your phone is charged too.

Take a full system backup, because these steps wipes the Android clean.

And ensure your laptop doesn’t go into suspend mode while you do this.

Now install a few packages:

sudo apt-get install android-tools-adb

sudo apt-get install fastboot

sudo add-apt-repository ppa:phablet-team/tools
sudo apt-get update
sudo apt-get install phablet-tools

Step 1: Installing Android 5.0

NOTE: This will wipe the system clean so if you haven’t backed up, go and back up first.

Download the correct file from the Google site:

https://developers.google.com/android/nexus/images

For Nexus 4 it is called.

occam-lrx21t-factory-51cee750.tgz

Now extract the files, it will show you a directory

occam-lrx21t

Change to this directory occam-lrx21t

Now boot into the bootloader, remember this step as you will need to do it a few times.

adb reboot bootloader

If it’s not able to find the device,  you can boot manually.

For nexus 4, while holding the volume button down, press the power button.

Now unlock the device with the following command.

fastboot oem unlock

Now flash the Android 5.0 Image by running this command from the directory above.

./flash-all.sh

After a few minutes, On the phone you will see a new boot up logo for Android 5.0. this will take a few minutes to complete. Grab a coffee or your favourite beverage.

Once this is complete, wait you still have to root the device.

wait, don’t do much on your android, as the unlock process may wipe your data!

Step 2: Rooting Android.

Download the rooting script from chainfire: http://download.chainfire.eu/297/CF-Root/CF-Auto-Root/CF-Auto-Root-mako-occam-nexus4.zip

When you scroll down, you see the actual link to download.

This will download this file: CF-Auto-Root-mako-occam-nexus4.zip

Extract this directory, change to this directory.

Now boot into the boot loader with your preferred method. I used volume down button + power on.

Now type these commands.

chmod +x root-linux.sh 
./root-linux.sh

Step 3: Installing MultROM manager

Find the app in Google Play and Install.

Start the app. This will ask you to install 3 things, go ahead and install.

Screenshot_2014-11-23-23-52-01

It will also boot into recovery mode.

Once its done, it will reboot and start android.

Now start the MultROM manager again.

You should see the option to install Ubuntu Touch.

Screenshot_2014-11-23-23-55-30

Step 4: Installing Ubuntu Touch

If you want demo files, select the -demo

you can choose stable OR development version, you can also install both one by one.

This step took the longest amount of time for me. Go get a nap!

It will ask you to reboot once.

Screenshot_2014-11-24-07-49-06

Once this is done, there is no intimation that it is completed.

When you reboot, it will give you an option to boot internal (Android) or Ubuntu Touch. Here you can select Ubuntu Touch and boot into it and setup.

Final Housekeeping. Boot into bootloader and lock the boot loader again:

fastboot oem lock

click on start to reboot your system.

Note: If you upgrade your Android, you will lose the dual-boot and have to start again from step 2 which may differ with your android version.