To get rid of the warning you must install the gtk2-engines-pixbuf package.
If that doesn't fix it you can use, for example, nano
, is not as easy as gedit but you should be able to make the modifications the tutorial states.
Just type:
sudo nano /etc/default/grub
navigate with the arrows, save with [Ctrl] + O
and exit with [Ctrl] + X
This depends on whether your operating systems are installed in UEFI mode or Legacy mode.
(If your PC is manufactured in the last 5-6 years, and came pre-installed with an operating system, it will most likely be UEFI.)
There is a similar question that you can follow to check whether you are using Legacy or UEFI.
Note: Irrespective of which mode you install in, if you simply delete the Ubuntu partition, it won't make the Windows bootloader default automatically. You have to do it once, manually.
If you install in Legacy mode and then delete the Ubuntu partition
You'll most likely end up in a grub rescue
prompt on the next boot. You'll need a bootable recovery disk (either Windows or Linux) to help you restore your Windows boot sector.
Here is a similar question that can help in this case.
If you install in UEFI mode and then delete the Ubuntu partition
You'll most likely end up in a GRUB command line prompt on the next boot, from where you'll have to boot to Windows and delete the GRUB EFI Firmware entry or change the order to put the Windows bootloader in the first place.
Here is a similar question that can help in this case.
So, what's the better way?
For Legacy
Boot to Windows first and use the bootsect
tool to replace the GRUB boot sector with the Windows boot sector, and then delete the Ubuntu partition. Run these from an elevated Command Prompt :-
bootsect /nt60 SYS /mbr
bootsect /nt60 SYS
For UEFI
Manually delete the GRUB EFI boot entry and/or set the Windows bootloader to the first position before you get rid of Ubuntu.
This answer to a similar question explains the process for deleting it in Windows.
To perform this from Ubuntu, the efibootmgr
tool can be useful. Run :-
sudo efibootmgr -v
to see the entries currently in your bootloader, then run :-
sudo efibootmgr -b XXX -B
to delete entry XXX.
Best Answer
Customizing the
/etc/default/grub
fileThere are two ways of doing this using editing a grub file. These are described in the Ubuntu Community Documentation Grub2 page
The two ways are:
Finding the menuentry to set as the new default
To start we need to find out what we are booting or want to boot. Open a terminal with Ctrl+Alt+t and type in
You can see that the "saved" method can come in handy when booting multiple operating systems. Save the name of the entry you want e.g.
Windows NT/2000/XP (loader) (on /dev/sda1)
, we need it later.Editing the
/etc/default/grub
fileType in the terminal
and your password if asked. The nano editor will open.
A. Saved method - In my preferred way, I made the following changes from the standard grub file.
I changed the value of
GRUB_DEFAULT
tosaved
:I enabled the SAVEDEFAULT functionality by adding the following line:
B. Specific menuentry - In the way you are asking for
GRUB_DEFAULT
to the name of the Windows system you want to always boot. The name of the corresponding Grub menuentry can be found as described in the previous section.I wanted to have Window XP always set as default at boot, I would set
GRUB_DEFAULT
to"Windows NT/2000/XP (loader) (on /dev/sda1)"
:Note: Some versions of Ubuntu require single quote (') vice double quote (").
You could also set
GRUB_DEFAULT
to the line number in the menu entry list (with 0 being the first), but when the kernel in Ubuntu is updated grub adds the new kernel to the top of the list, you would have to change the number, since Windows is the last one in the menu entry list. You can see this in my menu entry list.Update the boot configuration
Now you have to run
to update the system generated
grub.cfg
file in the/boot/grub/
directory.Addendum
Notes on nano
nano
is especally easy to use in the terminal. Move around with the arrow keys. Type in you addtions, delete the unwanted.The
-B
or--backup
option backs up the previous version of it to the current filename suffixed with a~
. Very handy in case of the dreaded Fat pfinger effect.When you are through, Ctrl+o will allow you to save your edits by hitting Enter and Ctrl+x will close. These and other options are shown at the bottom of the terminal screen with the
^
indicating Ctrl.Notes about nano, sudoeditor and other editors
Some in the Ubuntu community suggest
sudoedit
instead ofnano
. I recommendnano
— which is the default sudoedit editor in later distributions of Ubuntu — instead ofsudoedit
, because the default can be overridden in non-obvious ways, unless you are an administrator.sudoedit
is safer in that it automatically saves a backup copy of the edited file, but the-B
command line option innano
does the same thing.nano
is more intuitive than editors likevi
oremacs
, which are very flexible but require learning a lot of commands, shortcuts or different modes.If you prefer not to use the
nano
editor and prefer the Gnome Text Editor, instead ofsudo nano -B
usegksu gedit
. I generally do this for large files, and/etc/default/grub
could easily be considered a large file. Thus type ingksu gedit /etc/default/grub
instead ofsudo nano -B /etc/default/grub
. Note that the Gnome text editor does not automatically make a backup!Notes on my grub file
I made some changes to grub for my personal needs. Such as the background picture of the moon launch. How to do these are discussed at the Ubuntu Community Documentation page on Grub2, recommended.
Good luck!