22

I have a system where I am dual-booting Ubuntu GNOME 15.10 and Ubuntu GNOME 16.04, however after installing Ubuntu GNOME 16.04, I have found that in the GRUB boot entry list it is called "Ubuntu", whereas the other one is called something like "Ubuntu GNOME 15.10", is there any way I can change the text of the "Ubuntu" one to "Ubuntu GNOME 16.04"? And also change the names of the other options so that instead of "Advanced options for Ubuntu" it says "Advanced options for Ubuntu GNOME 16.04" etc?

I rather do it manually if it is safe to do so, or a piece of software could be recommended, however nothing from a PPA or other untrusted not official source (I will only install software from the Ubuntu official repositories).

4 Answers4

22

Open the grub configuration file:

sudo nano /etc/default/grub

Just comment the line starting with GRUB_DISTRIBUTOR and add one line:

# GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_DISTRIBUTOR="Ubuntu 15.10"

Afterwards, run

sudo update-grub

It should work after the next reboot. You will need to boot to both ubuntu installations and to change both names.

Important Note: Something you'll want to avoid doing is editing the file /etc/lsb-release and modifying the value for DISTRIB_ID which is read from the command lsb_release -i -s. While this does work to rename the grub menu entry (if you haven't modified /etc/default/grub), other programs also rely on the default name and may crash if it's modified (e.g. "Ubuntu" for Xubuntu). With that said though, kernel updates also replace this file, which will undo any changes to it.

wjandrea
  • 14,504
davidbaumann
  • 1,915
10

There is a program called Grub Customizer that you can use for this. You can add, delete, move and rename entries. It also has a lot more features to set display resolution and so on.

See for yourself: https://launchpad.net/grub-customizer

Installation (Ubuntu >= 19.04):

The grub-customizer package is part of the default Ubuntu repositories:

sudo apt install grub-customizer 

Installation (older Ubuntu versions):

The following steps are copied from the page above:

sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt-get update
sudo apt-get install grub-customizer

Rename entry:

After the installation I have a new entry under Application > System Tools > Administration called Grub Customizer.

  1. Start Grub Customizer
  2. You will see the list of grub menu entries. Right click on one and choose "Rename".
  3. Enter the new name
  4. Click save in the toolbar and close the program

That's it.

1

To automatically insert Ubuntu version number, and your own text prefix, replace

GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`

with

# GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_DISTRIBUTOR=`{ printf My_Text_ && lsb_release -d -s ; } 2> /dev/null || echo Debian`

I typically put some identifying text like 750G_ for disk size in there, which would show

750G_Ubuntu 19.10

for Ubuntu 19.10.

This has been tested with Ubuntu 16.04 & 19.10. No, I do not know how to put a suffix. No, I do not know how to insert spaces. I have been swapping multiple disks around in multi-drive computers and just wanted confirmation of where I was.

brewmanz
  • 597
0

I have named my systems (see https://ubuntuhandbook.org/index.php/2016/06/change-hostname-ubuntu-16-04-without-restart/) and replaced

GRUB_DISTRIBUTOR=lsb_release -i -s 2> /dev/null || echo Debian

with

GRUB_DISTRIBUTOR=cat /etc/hostname || lsb_release -i -s 2> /dev/null || echo Debian

and that works well.

For grub see https://www.gnu.org/software/grub/manual/grub/grub.html#Configuration