• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

grub2-mkconfig: command not found

by admin

The grub2-mkconfig command generates a new grub.cfg configuration file, and is used to update an existing grub.cfg file. The grub2-mkconfig command combines the configuration file templates in the /etc/grub.d/ directory with the settings in /etc/default/grub to generate the grub.cfg configuration file.

Note: On some distributions, this command is simply grub-mkconfig.

Syntax

The syntax of the grub2-mkconfig command is:

# grub2-mkconfig [-o {file name}]

If you encounter the below error while running the grub2-mkconfig:

grub2-mkconfig: command not found

You may install the below package:

# dnf install grub2-tools-1

Rebuilding Your GRUB Configuration File

Whenever you change your GRUB configuration, you need to rebuild it. Follow the steps outlined below:

1. The command to rebuild your GRUB configuration varies. On Fedora and openSUSE, use this command:

$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg

Some distros, such as Ubuntu, use:

$ sudo grub-mkconfig -o /boot/grub/grub.cfg

2. Ubuntu Linux also has a script that runs grub-mkconfig, update-grub:

$ sudo update-grub

Filed Under: Linux

Some more articles you might also be interested in …

  1. chcon: command not found
  2. paste: command not found
  3. genkernel Command Examples in Linux
  4. scp: command not found
  5. rename: command not found
  6. lpinfo Command Examples
  7. rc-status: command not found
  8. fscrypt Command Examples in Linux
  9. joe Command Examples
  10. CentOS / RHEL : How to add a new Physical Volume to an existing Volume Group

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright