patch command not found

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

Introduction

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

patch: command not found

or when using sudo you get the following error message

sudo: patch: command not found

Solutions to patch: command not found

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

In Ubuntu patch is provided by patch package.

patch is:

Patch will take a patch file containing any of the four forms of difference listing produced by the diff program and apply those differences to an original file, producing a patched version.

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

sudo apt-get -y install patch

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

You can also use apt command to install patch.

sudo apt -y install patch

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

sudo aptitude install patch

Summary

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