macOS
brew install gpatchlocal Homebrew formula metadata
sudo port install gpatchMacPorts ports tree · devel/gpatch/Portfile · source: api.github.com
brew
Apply a diff file to an original. Version 2.8 via Homebrew; verified from local package data.
install
brew install gpatchlocal Homebrew formula metadata
sudo port install gpatchMacPorts ports tree · devel/gpatch/Portfile · source: api.github.com
sudo apk add patchAlpine Linux edge package indexes · patch · source: dl-cdn.alpinelinux.org
sudo apt install patchDebian stable package indexes · patch · source: deb.debian.org
sudo dnf install patchFedora Rawhide package metadata · patch · source: dl.fedoraproject.org
nix profile install nixpkgs#patchnixpkgs package indexes · patch · source: raw.githubusercontent.com
sudo pacman -S patchArch Linux sync databases · patch · source: geo.mirror.pkgbuild.com
sudo zypper install patchopenSUSE Tumbleweed package metadata · patch · source: download.opensuse.org
choco install patchChocolatey community package catalog · patch · source: community.chocolatey.org
scoop install main/patchScoop official bucket manifest trees · bucket/patch.json · source: api.github.com
winget install --id GnuWin32.Patch -eWindows Package Manager source index · GnuWin32.Patch · source: cdn.winget.microsoft.com
overview
Apply a diff file to an original
history
GNU patch applies diff output to original files to produce modified files. It descends from Larry Wall's patch program and became one of the basic tools of Unix source distribution, mailing-list development, and package-manager patch application.
The GNU patch README states that this GNU version applies diff files to original files and includes many Free Software Foundation changes: binary and large-file handling, unified diff support, merge behavior, GNU-style backup files, improved RCS and SCCS interaction, GNU option parsing/configure conventions, and better POSIX compliance.
The README also explains why the FSF distributed GNU patch independently: Larry Wall had not released a new version since mid-1988, and he agreed to GNU distribution under the GNU General Public License. GNU bulletins from the 1990s describe patch as GNU's version of Larry Wall's program for applying diff output.
patch became a standard Unix packaging primitive because source distributions could ship small textual changes instead of whole replacement trees. GNU patch's support for unified diffs, reject files, backup naming, and POSIX/GNU build conventions made it fit naturally into Autotools-era source packages and distribution build recipes.
The GNU diffutils manual shows the common form `patch <patchfile`, with optional original-file and patch-file arguments. If no patch file is supplied, patch reads diff output from standard input; if no input file is supplied, it tries to infer the file to edit from leading patch text.
For package maintainers, GNU patch is infrastructure rather than just a user command. It is the tool behind downstream patch queues, source RPM and Debian patch application, vendor backports, portability fixes, and decades of email-driven source exchange before pull-request platforms normalized repository-hosted review.
security posture
narrow executable package without higher-risk signals.
green risk · low confidence · appliance
Before unattended agent use, check whether the tool reads plaintext credentials, writes remote state, publishes artifacts, or shells out to plugins.
executables
| Command | Kind | Exposure | Note |
|---|---|---|---|
patch | cli | global executable |
freshness
These signals separate page generation age, package-manager activity, and upstream release comparison. Version lag is warned only when an evidence URL and comparable versions are present.
https://savannah.gnu.org/projects/patch/
install metadata
| Package key | brew:gpatch |
|---|---|
| Version | 2.8 |
| Package manager | Homebrew |
| Package manager page | https://formulae.brew.sh/formula/gpatch |
| Homepage | https://savannah.gnu.org/projects/patch/ |
| Repository | https://git.savannah.gnu.org/cgit/patch.git |
| Upstream docs | https://savannah.gnu.org/projects/patch |
| License | GPL-3.0-or-later |
| Source archive | https://ftpmirror.gnu.org/gnu/patch/patch-2.8.tar.xz |
| Bottle | available (on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, sonoma, ventura, x86_64_linux) |
| Homebrew post-install | not defined |
| Service | none declared |
| Caveats | GNU "patch" has been installed as "gpatch". If you need to use it as "patch", you can add a "gnubin" directory to your PATH from your bashrc like: PATH="$HOMEBREW_PREFIX/opt/gpatch/libexec/gnubin:$PATH" |
registry facts
| Source Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | gpatch |
| Version Scheme | 0 |
| Revision | 0 |
| Bottle Stable Root URL | https://ghcr.io/v2/homebrew/core |
| Deprecated | no |
| Disabled | no |
| Keg Only | no |
| URL Keys |
|
source database matches
Matches are pulled from external package-manager indexes and kept separate from local Automic Vault package links.
gpatch
sudo port install gpatchpatch 2.8-2
Apply a diff file to an original
https://savannah.gnu.org/projects/patch/
sudo apt install patchpatch
nix profile install nixpkgs#patchpatch 2.7.6-7build3
Apply a diff file to an original
https://savannah.gnu.org/projects/patch/
sudo apt install patchpatch 2.8-r0
Utility to apply diffs to files
https://www.gnu.org/software/patch/patch.html
sudo apk add patchpatch-doc 2.8-r0
Utility to apply diffs to files (documentation)
https://www.gnu.org/software/patch/patch.html
sudo apk add patch-docpatch 2.8-4.fc44
Utility for modifying/upgrading files
https://savannah.gnu.org/projects/patch/
sudo dnf install patchpatch 2.8-1
A utility to apply patch files to original sources
https://www.gnu.org/software/patch/
sudo pacman -S patchpatch 2.8-2.3
GNU patch
https://ftp.gnu.org/gnu/patch/
sudo zypper install patchpatch
choco install patchmain/patch
scoop install main/patchGnuWin32.Patch
winget install --id GnuWin32.Patch -esource trail
This page is generated by av-web from the private package SQLite artifact built by scripts/generate-pkg-sqlite.py.
View the package source record on GitHub.