How To Fix The “sudo: command not found” Error On Linux

This tutorial post will guide you through the solution to fix the “sudo: command not found” error on Linux. This error is very rare as sudo is installed by default in the most of the Linux operating systems. You will encounter this error when you try to install or peform any command using sudo privilege.

How To Fix The “sudo: command not found” Error On Linux

One and only solution to fix this error is by installing sudo in your Linux.

For Ubuntu or debian based operating system:

Run the following command to install sudo on Ubuntu or debian Linux:

apt install sudo

Now you need to add your user to the sudo group with the following command:

usermod -aG sudo your_username

For Arch-based systems:

Run the following command to install sudo on Arch based Linux operating system:

pacman -S sudo

Then, run the following to add the user to the wheel group on arch based distro:

usermod -aG wheel your_username

For Fedora and other RHEL-based distros

Run the following command to install sudo on RHEL based Linux operating system :

dnf install sudo

Then, add your user to the sudo group by running  the following command:

usermod -aG wheel your_username

Summary: This tutorial will guide you through the solution to fix “sudo: command not found” error on Linux. Let us know if there is any issues while running commands mentioned in this post.

Leave a Comment