mkfs.ext4 command not found
Introduction
When you run more command in linux terminal / console, you get the following error message
mkfs.ext4: command not found
or when using sudo you get the following error message
sudo: mkfs.ext4: command not found
Solutions to mkfs.ext4: command not found
How To Fix mkfs.ext4: command not found in Ubuntu / Debian / Kali Linux / Raspbian
In Ubuntu mkfs.ext4 is provided by e2fsprogs package.
e2fsprogs is:
The ext2, ext3 and ext4 file systems are successors of the original ext (“extended”) file system. They are the main file system types used for hard disks on Debian and other Linux systems.
This package contains programs for creating, checking, and maintaining ext2/3/4-based file systems. It also includes the “badblocks” program, which can be used to scan for bad blocks on a disk or other storage device.
To fix this problem, we can install more using the command below.
sudo apt-get -y install e2fsprogs
This command might take some time to finish depending on your machine internet connection.
You can also use apt command to install e2fsprogs.
sudo apt -y install e2fsprogs
Or if you have aptitude installed you can use the following command.
sudo aptitude install e2fsprogs
Summary
In this tutorial we learn how to fix mkfs.ext4 command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.