1

I installed grub2 to dual boot another OS alongside my Ubuntu 12.04 LTS, but decided against it at the last second.

So I just did sudo apt-get purge grub, and it said it had purged all grub files, so I rebooted and guess what appears? Grub.

How do I get rid of it?. I'm worried that the only way to get rid of it is to format my hard drive, or worse, even that won't help.

EDIT:

Basically I am only running Ubuntu 12.04 LTS and would like it to go back to doing what it used to do, which was booting itself with no annoying grub UI, just the quick F12 boot menu BIOS stuff then boot.

Hans
  • 1,301

2 Answers2

1

You can use get Grub to boot straight into Ubuntu without waiting by setting the value

GRUB_HIDDEN_TIMEOUT=0

In your /etc/default/grub file. This will select the default option on the list (I assume this is Ubuntu for you) and go straight in.

Mendhak
  • 4,530
0

To repair the bootloader:

To restore Grub to your system, if you have removed, or part-done another installatiob, installed Windows, etc:

sudo grub-install /dev/sdX

Where sdX gives your hard disk entry under /dev. Usually this is /dev/sda, but it can vary if it is on an external drive or something. You can find the disk entry in:

sudo fdisk -l

After, that run this (May not be required, but it should not hurt:)

sudo update-grub

You can check with:

sudo grub-install --recheck /dev/sdX 

To make Grub nor show on boot:

Edit/etc/default/grub:

sudo nano /etc/default/grub

and add/change this line:

GRUB_TIMEOUT=0

then run this to update the changes:

sudo update-grub

When it is runnning you will get something like this:

USERNAME@HOSTNAME:~$ sudo update-grub
[sudo] password for USERNAME:
Generating grub.cfg ... Found linux image:
/boot/vmlinuz-3.11.0-15-generic Found initrd image:
/boot/initrd.img-3.11.0-15-generic Found linux image:
/boot/vmlinuz-3.11.0-12-generic Found initrd image:
/boot/initrd.img-3.11.0-12-generic Found memtest86+ image:
/boot/memtest86+.bin
Found Fedora release 20 (Heisenbug) on /dev/sda2
done USERNAME@HOSTNAME:~$

The Ubuntu kernels would likely be the linux and and initrd entries, other Operating Systems should appear after Found ...

Manual on configuring grub here


Other useful stuff:

You can also set this in /etc/default/grub:

GRUB_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT=3

Which would mean that it would not display the selection menu for 3 seconds, allowing you to use it if you need to by pressing Any Key, and then it would boot.

If you want the kernel that is selected in the menu to always be the default selection, add/change these lines:

GRUB_SAVEDEFAULT=true
GRUB_DEFAULT=saved

Remember to run sudo update-grub to update the changes (or it won't do anything), and there is the manual for more options.

For easier and more advancded configuration of Grub, you may want to use Grub Customizer

If you did remove grub, you may need to reinstall it with apt-get. Grub is the bootloader for most Linux systems, this problem likely would of been caused by the Debian Grub overwriting the Ubuntu Grub.

Wilf
  • 30,732