sh command not found

In this troubleshooting guide we learn how to fix sh command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

sh: command not found

or when using sudo you get the following error message

sudo: sh: command not found

Solutions to sh: command not found

How To Fix sh: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu sh is provided by dash package.

dash is:

The Debian Almquist Shell (dash) is a POSIX-compliant shell derived from ash.

Since it executes scripts faster than bash, and has fewer library dependencies (making it more robust against software or hardware failures), it is used as the default system shell on Debian systems.

To fix this problem, we can install more using the command below.

sudo apt-get -y install dash

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install dash.

sudo apt -y install dash

Or if you have aptitude installed you can use the following command.

sudo aptitude install dash

Summary

In this tutorial we learn how to fix sh command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.