5

I have a debian Gnu/linux installed in my system and I want to dual boot ubuntu.Can I install ubuntu without replacing debian bootloader?

2 Answers2

5

You can let Ubuntu replace grub with Ubuntu's or keep the old one. This is the default, and works well. You will be able to boot the other linux system(s) too.

In BIOS mode, if you want to keep the old one, you should select 'Something else' at the partitioning page, where you can select to install grub to the partition instead of the head of the drive. This does not work in UEFI mode: even if you select correctly, it will use the default settings.

If you keep the old bootloader, you will not see the new system (Ubuntu) until you run

sudo update-grub

in the old system (and reboot).

sudodus
  • 46,324
  • 5
  • 88
  • 152
  • 2
    You can use command line and option -b to not install grub. This launches the installer program (Ubiquity) with an option (-b) to not install a boot loader from live installer in live mode: In the Terminal window, type ubiquity -b. http://askubuntu.com/questions/838450/how-can-ubiquity-be-forced-not-to-install-grub/838527#838527 – oldfred Dec 09 '16 at 18:57
  • 1
    If you do end up accidently installing the ubuntu bootloader and want to put back the Debian one that is also pretty easy. Just boot up debian and run "update-grub" followed by "grub-install " (the value of is ignored for UEFI) – Peter Green Dec 09 '16 at 20:01
2

In my experience it does not work very well to have two distributions share a common GRUB install. They don't always know which files belong to which distribution, and even keeping track of it at the file level would not be sufficient since the file containing the menu would contain lines belonging to each of the installed distributions.

Another approach which I think works better is to have multiple GRUB installs. Each installed distribution have their own GRUB install in their own /boot directory.

Only one of those GRUB installs will be loaded by the MBR. Installing GRUB to the MBR will overwrite any previous GRUB loader in the MBR. So the system will boot into the GRUB belonging to the distribution from where you latest installed to the MBR.

You can however boot GRUB from GRUB, which allows you to create menu entries to easily switch between the different GRUB installs. For example you could create an entry like this in /etc/grub.d/40_custom:

menuentry 'Precise' {
    multiboot (hd1,1)/precise/boot/grub/core.img
}

Obviously the exact disk and partition number may be different on your system. Also notice that the location of core.img is different as older distributions used /boot/grub/core.img and newer distributions use /boot/grub/i386-pc/core.img.

After changing any of the files in /etc/grub.d you need to run update-grub.

kasperd
  • 1,729