0

I want to clean up the entries in GRUB on Ubuntu 22.04 since there are a lot of duplicates:

Here's a screenshot of the GRUB menu:

photo of screen showing GRUB menu

Everything seems to be listed twice.

I already ran apt-get autoremove --purge, but there was nothing to remove. Here's the output of update-grub2:

Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.15.0-71-generic
Found initrd image: /boot/initrd.img-5.15.0-71-generic
Found linux image: /boot/vmlinuz-5.4.0-147-generic
Found initrd image: /boot/initrd.img-5.4.0-147-generic
Found linux image: /boot/vmlinuz-3.5.0-54-generic
Found initrd image: /boot/initrd.img-3.5.0-54-generic
Found linux image: /boot/vmlinuz-3.5.0-23-generic
Found initrd image: /boot/initrd.img-3.5.0-23-generic
Found linux image: /boot/vmlinuz-5.15.0-71-generic
Found initrd image: /boot/initrd.img-5.15.0-71-generic
Found linux image: /boot/vmlinuz-5.4.0-147-generic
Found initrd image: /boot/initrd.img-5.4.0-147-generic
Found linux image: /boot/vmlinuz-3.5.0-54-generic
Found initrd image: /boot/initrd.img-3.5.0-54-generic
Found linux image: /boot/vmlinuz-3.5.0-23-generic
Found initrd image: /boot/initrd.img-3.5.0-23-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Windows 10 on /dev/sda1
Found Windows 10 on /dev/sda1
Found linux image: /boot/vmlinuz-5.15.0-71-generic
Found initrd image: /boot/initrd.img-5.15.0-71-generic
Found linux image: /boot/vmlinuz-5.4.0-147-generic
Found initrd image: /boot/initrd.img-5.4.0-147-generic
Found linux image: /boot/vmlinuz-3.5.0-54-generic
Found initrd image: /boot/initrd.img-3.5.0-54-generic
Found linux image: /boot/vmlinuz-3.5.0-23-generic
Found initrd image: /boot/initrd.img-3.5.0-23-generic
Found Windows 10 on /dev/sda1
Found linux image: /boot/vmlinuz-5.15.0-71-generic
Found initrd image: /boot/initrd.img-5.15.0-71-generic
Found linux image: /boot/vmlinuz-5.4.0-147-generic
Found initrd image: /boot/initrd.img-5.4.0-147-generic
Found linux image: /boot/vmlinuz-3.5.0-54-generic
Found initrd image: /boot/initrd.img-3.5.0-54-generic
Found linux image: /boot/vmlinuz-3.5.0-23-generic
Found initrd image: /boot/initrd.img-3.5.0-23-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found linux image: /boot/vmlinuz-5.15.0-71-generic
Found initrd image: /boot/initrd.img-5.15.0-71-generic
Found linux image: /boot/vmlinuz-5.4.0-147-generic
Found initrd image: /boot/initrd.img-5.4.0-147-generic
Found linux image: /boot/vmlinuz-3.5.0-54-generic
Found initrd image: /boot/initrd.img-3.5.0-54-generic
Found linux image: /boot/vmlinuz-3.5.0-23-generic
Found initrd image: /boot/initrd.img-3.5.0-23-generic
done

And here is a list of of /etc/grub.d/:

-rwxr-xr-x 1 root root 10627 Dez  2 16:20 00_header
-rwxr-xr-x 1 root root  6260 Dez  2 16:18 05_debian_theme
-rwxr-xr-x 1 root root  1408 Mär  7  2020 06_linux_proxy
-rwxr-xr-x 1 root root 18683 Dez  2 16:18 10_linux
-rwxr-xr-x 1 root root 43031 Dez  2 16:18 10_linux_zfs
-rwxr-xr-x 1 root root 14180 Dez  2 16:18 20_linux_xen
-rwxr-xr-x 1 root root  2924 Feb  6  2022 20_memtest86+
-rwxr-xr-x 1 root root 13369 Dez  2 16:18 30_os-prober
-rwxr-xr-x 1 root root   188 Mär  7  2020 30_os-prober_proxy
-rwxr-xr-x 1 root root  1372 Dez  2 16:18 30_uefi-firmware
-rwxr-xr-x 1 root root  1448 Mär  7  2020 31_linux_proxy
-rwxr-xr-x 1 root root   188 Mär  7  2020 32_os-prober_proxy
-rwxr-xr-x 1 root root  1448 Mär  7  2020 33_linux_proxy
-rwxr-xr-x 1 root root 11298 Nov 11  2019 34_linux_xen
-rwxr-xr-x 1 root root   700 Jul  3  2022 35_fwupd
-rwxr-xr-x 1 root root  1992 Mär 12  2014 35_memtest86+
-rwxr-xr-x 1 root root  1418 Mär 22  2019 36_uefi-firmware
-rwxr-xr-x 1 root root   214 Jan 22  2013 40_custom
-rwxr-xr-x 1 root root   215 Dez  2 16:18 41_custom
-rwxr-xr-x 1 root root  1448 Mär  7  2020 42_linux_proxy
drwxr-xr-x 4 root root  4096 Okt  3  2014 backup
drwxr-xr-x 2 root root  4096 Okt  3  2014 bin
drwxr-xr-x 2 root root  4096 Mär  7  2020 proxifiedScripts
-rw-r--r-- 1 root root   483 Jan 22  2013 README

Can someone tell me where these duplicates come from and how I get rid of them?

karel
  • 122,292
  • 133
  • 301
  • 332
Jakob
  • 1

1 Answers1

0

I had the same problem and I solved it using Grub-customizer.

I launched grub-customizer and in the list provided (I have 4 Linux distros (debian, ubuntu, mint and elementary), I moved all the main entries to the top and deleted everything else. After reboot the boot menu now shows only my four distros.

To install grub-customizer:

sudo add-apt-repository ppa:trebelnik-stefina/grub-customizer
sudo apt update
sudo apt install grub-customizer
karel
  • 122,292
  • 133
  • 301
  • 332