• 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

kexec: command not found

by Deepika

“kexec” is a Linux system call that enables the kernel to load and boot into another kernel, bypassing the BIOS or firmware boot loader. This allows the system to reboot directly into a new kernel without going through the process of shutting down and restarting the system.

The kexec system call is useful in several scenarios, such as:

  • Developers who are testing new kernels and want to quickly switch between different versions without the need for a complete reboot.
  • It can be used in situations where the system is unable to boot due to a problem with the current kernel, and a new kernel is needed to fix the issue.

The kexec system call requires the kernel and initrd (initial ramdisk) of the new kernel to be loaded into memory before executing the kexec system call. This means that the new kernel must be compatible with the current hardware and must have the necessary drivers and modules required to boot the system.

It’s important to note that kexec is not a replacement for a full reboot and is not suitable for all cases. Also, it should be used with care as it may cause data loss and system instability if not used properly.

If you encounter the below error while running the command kexec:

kexec: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
Debian apt-get install kexec-tools
Ubuntu apt-get install kexec-tools
Arch Linux pacman -S kexec-tools
Kali Linux apt-get install kexec-tools
CentOS yum install kexec-tools
Fedora dnf install kexec-tools
Raspbian apt-get install kexec-tools

kexec Command Examples

1. Load a new kernel:

# kexec -l path/to/kernel --initrd=path/to/initrd --command-line=arguments

2. Load a new kernel with current boot parameters:

# kexec -l path/to/kernel --initrd=path/to/initrd --reuse-cmdline

3. Execute a currently loaded kernel:

# kexec -e

4. Unload current kexec target kernel:

# kexec -u

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to split iso or file using ‘split’ command in Linux
  2. “git rm” Command Examples
  3. login: command not found
  4. mktemp: command not found
  5. rspamc Command Examples in Linux
  6. How to Compress and Extract Files and Directories in Linux Using gzip and bzip2
  7. xz: command not found
  8. aws-vault Command Examples (A vault for securely storing and accessing AWS credentials in development environments)
  9. ganache-cli: Command-line version of Ganache, your personal blockchain for Ethereum development
  10. nethogs: command not found

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