GRUB, or the Grand Unified Bootloader, is a key part of many Linux distributions, including Ubuntu 18.04. It’s the screen that appears when you first boot up your computer, allowing you to select which operating system to use. By default, GRUB waits for a few seconds before automatically booting the default operating system. However, if you want to speed up your boot time or simply don’t need the GRUB menu, you can set the GRUB timeout to 0. This article will guide you through the process.
To set the GRUB timeout to 0 on Ubuntu 18.04, you need to modify the
/etc/default/grub configuration file. Locate the line that says
GRUB_TIMEOUT and change the value to 0. Save the changes, update GRUB, and restart your computer. Afterward, your system will boot the default operating system immediately without displaying the GRUB menu.
Understanding GRUB Timeout
The GRUB timeout is the number of seconds the GRUB menu will display before it automatically boots the default operating system. By setting this value to 0, the GRUB menu will not display at all, and the system will boot the default operating system immediately.
Modifying the GRUB Configuration File
To set the GRUB timeout to 0, you need to modify the
/etc/default/grub configuration file. Here’s how:
- Open your terminal. You can do this by pressing
Ctrl + Alt + Ton your keyboard.
- Enter the following command to open the GRUB configuration file in the nano text editor:
sudo nano /etc/default/grub
sudocommand allows you to run commands with administrative privileges, while
nanois a simple, easy-to-use text editor included with most Linux distributions.
- In the file, locate the line that says
GRUB_TIMEOUT. This line determines how long GRUB waits before booting the default operating system.
- Change the value of
GRUB_TIMEOUTto 0, so the line reads
GRUB_TIMEOUT=0. If the line is not present, add it. Make sure the line is uncommented (i.e., there is no
#at the beginning of the line).
- Save the changes by pressing
Ctrl + Oand then hit
Enter. Exit the nano editor by pressing
Ctrl + X.
Updating the GRUB Configuration
After modifying the GRUB configuration file, you need to update GRUB for the changes to take effect. Here’s how:
- In the terminal, run the following command:
update-grubcommand generates a new GRUB configuration file based on the settings in
/etc/default/gruband other configuration files.
- Wait for the command to complete. It should display a message saying that the operation was successful.
- Finally, restart your computer to apply the changes. You can do this by running the command:
After your computer restarts, it should boot the default operating system immediately, without displaying the GRUB menu.
Setting the GRUB timeout to 0 can help you boot your Ubuntu 18.04 system more quickly, especially if you only have one operating system installed. However, remember that if you need to access the GRUB menu again, you’ll need to press and hold
Shift during boot.
Remember to be careful when modifying system files, as incorrect changes can cause issues with your system. If you encounter any problems, you can always change the
GRUB_TIMEOUT value back to its original value and update GRUB again.
To access the GRUB configuration file, open your terminal and enter the command
sudo nano /etc/default/grub. This will open the file in the nano text editor.
Uncommenting a line in the GRUB configuration file means removing the
# symbol at the beginning of the line. This allows the line to be read and executed by the system.
To save changes in the nano text editor, press
Ctrl + O to write the changes to the file, and then hit
To exit the nano text editor without saving changes, press
Ctrl + X. You will be prompted to save changes, and you can choose to discard them by pressing
Ctrl + C.
sudo update-grub command generates a new GRUB configuration file based on the settings in
/etc/default/grub and other configuration files. It updates the GRUB menu to reflect any changes made.
To restart your computer using the terminal, run the command
sudo reboot. This will initiate a system reboot. Note that you may be prompted to enter your password before the restart occurs.