20

I searched the Internet for instructions on how to remove GRUB, but the only thing I could find was using a Windows DVD to "repair" the system. I previously had a Windows/Linux doal-boot and removed Windows (GParted + Boot-Repair), but GRUB is still installed with only one entry: the Linux one.

How can I uninstall GRUB and directly boot on a Debian-based OS?

Magix
  • 211

6 Answers6

37

While you can uninstall GRUB, that would mean you have to set up another bootloader and is probably not worth it. There is no reason to use another one since you just want the GRUB screen to be hidden. I believe that all of the other bootloaders work in similar ways, so you shouldn't worry about installing something else.


If what you want to do is hide GRUB. This is possible, and quite easy. Press Alt+F2 and paste this before hitting Enter: gksudo gedit /etc/default/grub.

A text-editor window will open, showing something like:

GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
#GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=”`lsb_release -i -s 2> /dev/null || echo Debian`”
GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”
GRUB_CMDLINE_LINUX=”"

Remove the two #s before GRUB_HIDDEN_TIMEOUT and GRUB_HIDDEN_TIMEOUT_QUIET. Save the file, open a terminal and run sudo update-grub. Reboot and you should have no GRUB window show up.

Also set GRUB_HIDDEN_TIMEOUT to 1 to avoid potential problems. GRUB will flash by, but it won't sit there for 10 seconds.


If you want, you can do this graphically.

Run these commands in a terminal window:

sudo add-apt-repository ppa:danielrichter2007/grub-customizer 

sudo apt-get update

sudo apt-get install grub-customizer

Once that's done, search for and open GRUB Customizer.

Go to the General tab and deselect show menu and look for other operating systems. Click the refresh button (blue circular arrow near the top right) and then click save.

(NOTE: GRUB Customizer does not seem to support EFI/GPT based systems.)

Reboot and see no bootloader.

Source: http://ubuntuhandbook.org/index.php/2014/06/ubuntu-1404-hide-grub-menu/

terdon
  • 104,119
TheWanderer
  • 19,525
  • 12
  • 52
  • 65
13

All the other answers start good, advising you that GRUB is usually there whether you see it or not, you probably shouldn't start taking random potshots at it, and how to restore your system to the 'hidden GRUB' you (presumably) previously enjoyed.

However, they end up going wrong - in making blanket statements that GRUB is always required, when this is just not the case. I guess they're oversimplifying on the assumption that your (XY) question is really 'How do I make things how they were before?', rather than specifically 'How do I destroy GRUB?'. But my concern is that, if not qualified, this response is counterproductive: rather than merely omitting to mention the alternative, they're outright stating there is no alternative.

So, for reference, I can say from everyday experience that Debian now ships with a UEFI stub compiled into its kernel, enabling the kernel to be directly booted without any middleman by your firmware, assuming it is a competent EFI-compliant firmware. This is not esoteric knowledge, though neither is it a default. Anyway, unsurprisingly, it looks like this ability is inherited and perfectly usable by Ubuntu, e.g.: How to boot load the kernel using EFI stub (efistub) loader?

But again, though this technically matches your question, you might not have been asking what you thought you were asking! You're best to combine this with the other (correct!) parts of the other answers, and decide whether (hidden) GRUB or EFI suits you. The usual disclaimers apply: Don't mess with EFI if you're not technically confident yet. Treat any thread like that link as an example only: customise exactly to the needs of your system. Enjoy!

underscore_d
  • 293
  • 4
  • 13
4

I am not knowledgeable enough to answer weather GRUB is required or not, but if your goal is to hide GRUB completely , I have a better solution than the accepted answer.

In order to achieve the fastest possible boot, instead of having GRUB wait for a timeout, it is possible for GRUB to not print the menu, unless the Shift key is held down during GRUB's start-up. This allows you to quickly boot to your default OS, but provides the flexibility to boot into another installed OS when the need arises infrequently.

In order to achieve this, you should add the following line to /etc/default/grub:

 GRUB_FORCE_HIDDEN_MENU="true"

Then create this file in '/etc/grub.d/' named 31_hold_shift, make it executable, and regenerate the grub config file:

chmod a+x /etc/grub.d/31_hold_shift
update-grub

That should do the job!

Find more GRUB Tricks here.

daltonfury42
  • 5,559
0

You cannot remove GRUB, this is needed, Windows just show some graphics - a picture. You need something to configure the OS with the correct drivers and set it up correctly.

The alternative is "refit" and "refind". This will show a grey screen with a penguin for Linux, and will allow you to select boot options with your mouse and hide the mess just as on Windows. These are open source projects, it is just to participate and make your own variant, including a neat graphic interface to Grub.

Knut H
  • 1
0

Do not try to remove grub, it is used as the bootloader for Ubuntu, just like the Windows mbr, which you just do not see.

You could try to install the program grub-customizer, which lets you define different settings for grub in a simple GUI. You could set the timeout to 0 and tell it to always boot the first entry, so you will directly boot Ubuntu without further input.

I believe this is also what happens automatically when you install Ubuntu as the only OS.

Prototype700
  • 1,120
0

You would need a boot loader anyway. In case you don't like grub, there are others: see comparison of boot loaders.

But I wouldn't use a boot loader not supplied with the main distribution. It may give you many headaches in the future when you upgrade the operating system.

In case you want to clear a boot loader from MBR (including grub), use le --mmap-rw /dev/sda:0:218 and fill all the space with zeros. You would need LE (text editor). But this procedure won't install another boot loader for you, so the system may become unbootable, if a boot loader is not installed on another disk.

In MS-DOS, fdisk /mbr c: can restore DOS boot loader in the MBR.

lav
  • 101