If you have both Ubuntu and Windows installed on your computer like I have and want to set a default operating system, you can easily do so in Ubuntu by following these steps:

  1. Open the terminal either by searching for “Terminal” in the applications menu or pressing Ctrl + Alt + T.
  2. Once the terminal is open, type the command “sudo nano /etc/default/grub” and hit Enter.
  3. You will be prompted to enter your user password. After entering your password, press Enter.
  4. The text editor will now open with the GRUB configuration file. Locate the line that begins with “GRUB_DEFAULT=” and change the value within the quotation marks to the number of the desired default OS. For example, if you want to set Windows as the default OS and it is the second option in the GRUB menu, change the value to “1“. The first option starts with “0“.
  5. After making the necessary changes, save the file by pressing Ctrl + X, then Y, and finally Enter.
  6. Update GRUB by running the command “sudo update-grub” in the terminal.
  7. Restart your computer and the default OS should now be the one you specified.

Remember that modifying the GRUB configuration file can be risky and may cause your system to become unbootable. Therefore, it is recommended to make a backup of the original file before making any changes.