16

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

1
15

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.

5
  • 1
    Is there no way of changing the names of the other options too? Or is that done automatically based on the names of the OSs?
    – user364819
    Apr 20 '16 at 17:42
  • You can turn off almost all the scripts and add anything you want to 40_custom as your own boot stanza with any description. And if you boot partition (link to kernel) instead of kernel you do not have to edit with every kernel update.How to: Create a Customized GRUB2 Screen that is Maintenance Free.- Cavsfan help.ubuntu.com/community/MaintenanceFreeCustomGrub2Screen AND: help.ubuntu.com/community/Grub2/CustomMenus
    – oldfred
    Apr 20 '16 at 17:53
  • Does not work with mine LinuxMint KDE 18.3, names are still the default ones
    – WooYek
    Feb 21 '18 at 12:53
  • Did work on Ubuntu 18.04 with the interesting side effect the colors of Grub changed from black/white to black/blue/white.
    – monty
    May 23 '18 at 18:41
  • A neater idea is to use GRUB_DISTRIBUTOR=`lsb_release -d -s 2> /dev/null || echo Debian`. The '-d' option will return 'Ubuntu 19.10' or other such version as it is. NB Only tested for version 19.10
    – brewmanz
    Feb 4 '20 at 1:23
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.

2
  • As I already stated in my question, I do not wish to install anything which is not from the official repositories, so PPAs aren't an option. Is this not available in the official repositories?
    – user364819
    Apr 20 '16 at 17:52
  • 1
    Sorry, must have missed that. I don't think it is in the official repository. It's a nice and easy way if you don't want to edit config files with an editor. I'll still leave the answer in case it helps somebody else. Apr 20 '16 at 17:54
0

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy