patch: Applies diffs and patches to files#


‘patch’ takes a patch file containing a difference listing produced by the ‘diff’ program and applies those differences to one or more original files, producing patched versions.

The version of ‘patch’ included is the GNU one. Some of the ‘diff’ files produced by GNU ‘diff’ are not acceptable to some versions of the ‘patch’ command, such as the ‘patch’ command that comes with Solaris.


This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.

Upstream Contact#

Main web site:

Bug database:

Submit bugs:

Mailing lists:

Special Update/Build Instructions#

In the event patches ever need to be made to this package, the method of applying the patches should not rely on the ‘patch’ existing on the system.




Version Information#



Equivalent System Packages#

$ apk add patch
$ sudo pacman -S patch
$ conda install patch
$ apt-cyg install patch
$ sudo apt-get install patch
$ sudo yum install patch
$ sudo pkg install devel/patch
$ brew install gpatch
$ sudo port install gpatch
$ sudo zypper install patch
$ sudo slackpkg install patch
$ sudo xbps-install patch


If the system package is installed, ./configure will check if it can be used.