How do I find the version of GRUB that is running in a particular version of Ubuntu? I want a terminal command that tells me.
On clean ubuntu installs the grub package itself doesn't seem to be installed. Thus typing 'grub -anyoption' results in an error that says grub is not installed. However you can type for example
And it will give you the correct version of grub currently installed
The version of the Grub is
EDIT: As others have pointed out the commandline flags have been changed in newer versions. So now instead of typing
grub-install -v you'd have to use a capital 'V' or the explicit
The package name is grub-pc, so you can do this:
dpkg -l grub-pc
which will show you something like this:
Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-========================================-=========================-=========================-===================================================================================== ii grub-pc 2.02~beta2-9ubuntu1.7 amd64 GRand Unified Bootloader, version 2 (PC/BIOS version)
I'll throw my hat into the ring as well. You can also do it with
apt-cache policy grub-pc
:~$ apt-cache policy grub-pc grub-pc: Installed: 2.02-2ubuntu8.7 Candidate: 2.02-2ubuntu8.7 Version table: *** 2.02-2ubuntu8.7 500 500 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages 100 /var/lib/dpkg/status 2.02-2ubuntu8 500 500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
to find out what bootloader you're using, you have to look at the bootloader!
dd if=/dev/sda bs=512 count=1 2> /dev/null | grep -q GRUB && echo "GRUB found"
All querying of installed packages, as described in the other answers, miss an important point: to probe your bootloader, look at the bootloader!
In other words, you can install whatever packages you like in whatever OS or distro you like, but none of this has anything to do with the bootloader you'll use when you reboot.
specifically, for MBR/msdos partitioned disks: probe the MBR (i.e. look at the bootloader to see what bootloader you're using)
This duplicate has some good answers: How do I find out which boot loader I have?
I like this more complete answer, found in a newer question: