How to remove duplicate entries in Grub menu?

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


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...
    to
    }
    ### 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.


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.


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 two kernel versions available just in case something goes wrong.