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?

4
  • 2
    Support for booting Linux directly without using a boot loader was removed 13 years ago during the 2.5 releases. It was removed because at the time it already suffered from major drawbacks compared to using a full boot loader.
    – kasperd
    Feb 8, 2016 at 12:32
  • 2
    @kasperd Well, now it's back, via EFIstub. Feb 8, 2016 at 12:37
  • @underscore_d Might be. I don't know enough about EFI to say whether the two are comparable.
    – kasperd
    Feb 8, 2016 at 13:00
  • For any who find this and actually did want to remove grub, this answer accomplished what I was after, namely use another distro for bootloader and disable ubuntu's altogether. tl;dr: apt-get remove grub* and then apt-mark hold grub*.
    – Hendy
    May 8, 2017 at 21:39

6 Answers 6

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/

3
  • 8
    Still an awful answer. Again: There are lots of ways to boot a system and lots of boot managers out there besides GRUB. You are literally telling people they are WRONG to want any of them. And on top of this, on a multiboot system, you certainly don't necessarily need to use a single OS's GRUB when they can all detect and boot each other. Seriously, why is the answer to "how do I remove GRUB" always "here is how to keep GRUB"?! If you don't know how, don't answer; leave a comment. If you do, at least post an answer that actually answers the question before your opinion.
    – user541686
    Sep 3, 2017 at 13:13
  • 2
    Why so harsh @Mehrdad? Why all those bold texts? While it's true that GRUB is not the only bootloader out there, I think he/she has correctly identified the question as a clear case of XY problem, where 99% of the people asking how to remove GRUB don't give a damn thing about passing to another bootloader and just want to get rid of the initial menu. It's the question to be "wrong"; the answer is absolutely correct, IMHO. May 19, 2018 at 19:53
  • 1
    @AndreaLigios I share Mehrdad's frustration that this answer is currently voted most useful. He's right after all: this answer is really no answer at all. It's not a bad idea to give people a warning if you think it might be common to take a wrong turn and end up here, but then you should go on to answer the question.
    – thohl
    Apr 11, 2019 at 2:02
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!

2
  • 10
    You're right, underscore_d, but it goes even further than that. If the machine is booting in BIOS/CSM/legacy mode, alternatives to the default GRUB 2 include LILO, SYSLINUX, and GRUB Legacy; and if it's booting in EFI mode, alternatives include ELILO, SYSLINUX, GRUB Legacy, and the EFI stub loader, with the last of these being selectable via the firmware's built-in boot manager, gummiboot/systemd-boot, rEFInd, or even (awkwardly) rEFIt. In sum, the number of boot loader (and boot manager) options is pretty large. Switching from GRUB 2 may not be Magix's best option, but alternatives do exist.
    – Rod Smith
    Feb 8, 2016 at 3:13
  • 1
    @RodSmith Excellemt points! Maybe you should post that as an answer, as it probably deserves more votes than mine :) I was writing mostly from experience only: GRUB is the most popular, and I went straight from that to EFIstub. I have used rEFIt to repair my EFI (it's buggy...) and heard briefly about the rest, but they didn't cross my mind yesterday (too tired!) Feb 8, 2016 at 8:54
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.

0
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.

5
  • 3
    GRUB might be the default, but it is by no means required. Feb 8, 2016 at 2:33
  • 5
    Please, stop telling people that grub is an absolute necessity. Before EFI, a bootloader was totally a necessity, but since EFI, you don't need them anymore. The Linux kernel has a way to be booted directly from EFI, without grub, without lilo, without rEFInd and others. And by the way, mbr is not a bootloader, it is just a table for partition to point to to find the bootloader.
    – Dolanor
    Feb 8, 2016 at 9:49
  • 9
    A boot loader is required with either BIOS-mode or EFI-mode booting. EFI provides its own boot manager, which enables selecting what to boot; but a boot loader (which transfers control to the kernel) is still required. Where it gets a little dicey is that the EFI stub loader turn the kernel into its own EFI-mode boot loader, but technically it's still a boot loader. GRUB 2 is just one of several boot loaders available, but it is the default used by Ubuntu.
    – Rod Smith
    Feb 8, 2016 at 15:20
  • Oh okay, I was not aware of this. Thanks for clarifying. My reasoning was that the inquirer should not simply seek to remove grub, possibly ending up with an unbootable system, since this was not the point of question. Instead, I tried to make clear that the wanted result can be achieved by simply changing the grub settings. ;-) Feb 10, 2016 at 1:54
  • @RodSmith : Mmhh. I didn't know that the UEFI wasn't considered as a bootloader. I knew about the stub loader, but didn't it was the actual bootloader. Making things clearer. Thanks.
    – Dolanor
    Feb 15, 2016 at 22:10
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.

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .