I don't want to burn a CD, DVD or USB memory stick. And I don't care about saving the existing operating system (Linux Mint). I want to install Ubuntu (actually Kubuntu 12.04 LTS) to the computer directly from the ISO image. The image is for the Kubuntu Live DVD (3.5 GB).

The computer is now booted into Linux Mint. A set of command line steps would be satisfactory. In my mind, I simply need to trick the existing system into thinking I inserted a CD/DVD, right?

I know there is a similar question already but it does not have a good answer. The answer basically says, "see this link." I reviewed the link and I decided that StackExchange needs a good answer to this question. Furthermore, most answers at other places on the Internet assume the user is coming to Ubuntu from Windows. So I think this question is one that needs a good answer here. Thanks

@fossfreedom - did you read the answer to that question? It isn't really an answer -- at least it does not strike me as an answer worthy of StackExchange. Surely there is a better answer out there.
–
MountainXSep 1 '13 at 19:31

1

You can boot from an ISO, and also install. There is a wiki just for that.
–
mikewhateverSep 1 '13 at 19:38

note: the tail -n +4 means simply "which line grub starts to read the configuration from as is". the 4th line in this example is the first comment line, which is fine.

Grub reads the partitions in a different way than Ubuntu does. 'hd0' means first HDD which is read as sda by Ubuntu, and 8 is the partition which is the same as for Ubuntu. So in other words, (hd0,8) means 'sda8'.

To find out your partition, run this command in a Terminal:

sudo fdisk -l

Suppose your image is contained in the sda1 partition, you'd change (hd0,8) in the above line to (hd0,1) and if the image is in the sdb1 partition, you'd change (hd0,8) to (hd1,1).

Save and close this file and now run this command:

sudo update-grub

Reboot and choose the new ISO entry from Grub menu this time. Hopefully, it will boot successfully to the desktop.

Now, if you want to perform an installation from the same ISO, you'd need to unmount the ISO image first as it is mounted from a partition on your HDD (probably you've got a single HDD and want to install Ubuntu to the same HDD) and the installer needs to unmount any mounted partitions before it can make any changes.

So, from the Live CD environment, go to a Terminal and run:

sudo umount -l /isodevice

That's all. Now you can double-click the 'Install' icon at the desktop and proceed with the installation.

Using this to load Ubuntu 14.04 (64-bit), I had to change the kernel on line 4 of the menuentry to vmlinuz.efi, hence it became:linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile noprompt noeject
–
nanyaksMay 9 '14 at 5:48

1

I submitted a fix to above. tail -n +3 causes error. It's what used in normal 40_custom file, but this example has an additional echo line. It should be +4 in this case.
–
Timo JyrinkiSep 23 '14 at 16:32

1

@nanyaks Thank you, I also had to add .efi to the command (Ubuntu 14.10, 64-bit). Somehow grep referred to the partition I needed as (hd0,msdos7), while within the old Ubuntu install it was called sdb7.
–
dennisschagtMar 3 at 13:24