Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

After today's update, Ubuntu asked me to replace some files and I blindly accepted. After I restarted PC after the update, I saw duplicate entries in the grub menu:

enter image description here

Here's the image of the grub customizer.

enter image description here

Apparently, Grub Customizer can not save edited information.

Is there a way to remove duplicates from Ubuntu 12.04 grub menu and set Windows 7 on first position?

share|improve this question
up vote 3 down vote accepted

While a sudo update-grub2 should remove the duplicate enties, to bring the Windows menu-item at first position additionally do :

  1. sudo gedit /boot/grub/grub.cfg
  2. Cut the portion of text starting from
    ### BEGIN /etc/grub.d/30_os-prober ###
    menuentry "Windows 7...
    ### END /etc/grub.d/30_os-prober ###
    and pest it just before
    menuentry 'Ubuntu, with Linux..

  3. save the file and reboot.

  4. You have to perform steps(1-4) every time grub-pc package-update or a kernel-update happens to keep Windows menu-item at first place.

share|improve this answer
Samik thank you worked for me – Levan Jun 5 '12 at 12:47
Glad to know that helped, please accept the answer if you are not looking for other alternatives. – Samik Jun 5 '12 at 14:35
The Menuentry 'ubuntu with Linux', there are multiple of those. Which one is right to paste it before? – denNorske Mar 5 '13 at 10:56

For permanent fix:

sudo mv /etc/grub.d/30_os-prober /etc/grub.d/07_os-prober

and Windows will be on top even after updates

share|improve this answer

i think you've already been helped. But just in case a newbie needs an easy way to change the order of the grub menu and even delete (careful here!!) entries, there is a nice GUI way in linux to do so, with the grub-customizer.

Go to the terminal and type:

sudo add-apt-repository ppstrong texta:danielrichter2007/grub-customizer

sudo apt-get update

sudo apt-get install grub-customizer

Then look up the newly installed grub customizer, start it and you can move windows or ubuntu upwards / downwards in the list.

share|improve this answer

I have just went from an upgrade from 11.04 to 12.04 LTS.

While I cannot find an "expected" listing of /etc/grub.d/ for different OS versions anywhere, from another computer I have access to, the original 11.04 entries are:

$ ls /etc/grub.d/
00_header        10_linux      20_memtest86+  40_custom  README
05_debian_theme  20_linux_xen  30_os-prober   41_custom

On the updated PC, after the update, I have:

$ ls /etc/grub.d/
00_header        10_os-prober  30_memtest86+     40_custom
05_debian_theme  20_linux      30_os-prober      41_custom
10_linux         20_linux_xen  30_uefi-firmware  README

Obviously, I've gotten some entries there which are duplicates - so not even running sudo update-grub2 as @Samik suggest does not remove duplicate entries in this case.

The answer for this case would obviously be to remove the duplicate _os-prober and _linux entries, and then running sudo update-grub2.

share|improve this answer

You can also remove old unused kernel packages and this effectively removes also the grub entries and frees harddrive space. To do that you need to check what kernels are installed using:

 sudo dpkg -l | grep linux-image

And then you can remove the kernel image using:

 sudo apt-get remove linux-image-version_number

where version_number is the kernel version you want to remove. I recommend you leave at least to kernel versions available just in case something goes wrong.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.