Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

paku: pacman for Git Bash

paku is a pacman-compatible package manager for Git Bash (Git for Windows). It downloads packages from the official MSYS2 repositories and installs them per user into ~/.local, so you never need an administrator shell. Commands and options match MSYS2 pacman: paku -Syu, paku -S rsync, paku -Rs, paku -Qq.

paku is not affiliated with MSYS2, Arch Linux’s pacman or Git for Windows.

Status: usable for daily work. Install, upgrade, remove and signature checks work; see Limitations for what is missing.

Key features

  • pacman-compatible CLI: same operations, options and combined short flags (-Syu, -Qqe, -Rns) as MSYS2 pacman.
  • No admin rights: installs per user under ~/.local; programs land in ~/.local/bin.
  • Official MSYS2 repositories: msys, ucrt64 (x64) and clangarm64 (ARM64) packages.
  • x64 and ARM64: picks the environment from the real CPU, even when Git Bash runs under x64 emulation.
  • Reuses Git for Windows: packages already bundled with Git count as installed and are never replaced.
  • Single binary: one paku.exe, no dependency on curl, gpg, zstd or tar.

Quick start

In Git Bash:

curl -fsSL https://raw.githubusercontent.com/haba713/paku/master/install.sh | sh
paku -Sy                # download the package databases
paku -S rsync           # install rsync and its missing dependencies

Next steps:

  • Installation: prerequisites, PATH setup, manual install
  • Usage: searching, installing, upgrading and removing packages
  • Configuration: where files go, paku.conf, limitations

More information

Installation

Prerequisites

  • Windows x64 or ARM64
  • Git for Windows, which provides Git Bash
  • no administrator rights

Install script

In Git Bash:

curl -fsSL https://raw.githubusercontent.com/haba713/paku/master/install.sh | sh

The script downloads the latest release binary for your machine (x64 or ARM64), checks its SHA-256 checksum and installs it as ~/.local/bin/paku.exe.

curl | sh runs whatever the server returns. The script is about 50 lines; to read it first:

curl -fsSL https://raw.githubusercontent.com/haba713/paku/master/install.sh | less

Install a specific release

Set PAKU_VERSION:

curl -fsSL https://raw.githubusercontent.com/haba713/paku/master/install.sh | PAKU_VERSION=v0.1.0 sh

Add paku to PATH

If ~/.local/bin is not on your PATH yet, the script prints how to add it. Add it to Git Bash’s PATH in ~/.bashrc, then open a new Git Bash window:

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc

Avoid adding ~/.local/bin to the Windows user PATH for cmd and PowerShell: msys programs such as rsync need DLLs from Git’s usr\bin (msys-2.0.dll, msys-iconv-2.dll, …), which only Git Bash has on its PATH, so they fail to start there. Native Windows packages (mingw-w64-ucrt-x86_64-*, mingw-w64-clang-aarch64-*) keep their DLLs next to the program and would work, but the same directory holds both kinds.

Manual installation

  1. Download paku-x86_64.exe (x64) or paku-aarch64.exe (ARM64) and SHA256SUMS from the latest release.

  2. Verify:

    sha256sum -c --ignore-missing SHA256SUMS
    
  3. Copy the binary to ~/.local/bin/paku.exe.

Build from source

Only a Rust toolchain is needed; no Visual Studio:

rustup toolchain install stable-x86_64-pc-windows-gnu --profile minimal
export RUSTUP_TOOLCHAIN=stable-x86_64-pc-windows-gnu
git clone https://github.com/haba713/paku.git
cd paku && cargo build --release && cargo test --workspace
mkdir -p ~/.local/bin && cp target/release/paku.exe ~/.local/bin/

Code signing

The release binaries are not code-signed yet. On Windows 11 with Smart App Control enabled, Windows may block them.

Usage

paku takes the same operations and options as MSYS2 pacman. Run paku -h for help and paku -S -h for the options of one operation.

Example: install rsync

Install rsync, which Git Bash lacks:

paku -Sy                # download the package databases
paku -Ss '^rsync$'      # search by exact name; `paku -Ss rsync` also matches descriptions
msys/rsync 3.5.2-1 (net-utils)
    A file transfer program to keep remote files in sync

msys/ is the repository. If nothing matches, -Ss prints nothing and exits with code 1.

paku -Si rsync          # package details
paku -S rsync           # install it and its missing dependencies

Common commands

CommandWhat it does
paku -Sydownload the package databases
paku -Ss <text>search package names and descriptions
paku -Si <pkg>show package details
paku -Sllist packages in the repositories
paku -Sglist package groups
paku -S <pkg>install a package and its missing dependencies
paku -Syuupgrade all packages installed with paku
paku -Qlist packages installed with paku
paku -Rs <pkg>remove a package and the dependencies nothing else needs
paku -T <dep>check whether dependencies are satisfied

Combined short flags work as in pacman (-Syu, -Qqe, -Rns), and - reads targets from stdin.

When MSYS2 renames or merges a package, paku -Syu asks Replace <old> with <repo>/<new>? and, on yes, removes the old package and installs the new one, like pacman.

Package names

RepositoryHost CPUPackage name prefix
msysbothnone, e.g. rsync
ucrt64x64mingw-w64-ucrt-x86_64-
clangarm64ARM64mingw-w64-clang-aarch64-

paku picks the environment from the real CPU, even when Git Bash itself runs under x64 emulation.

msys programs like rsync use the msys-2.0.dll runtime from Git for Windows, so run them from Git Bash.

Packages bundled with Git

Packages bundled with Git for Windows (listed in /etc/package-versions.txt) count as installed, so dependencies like libiconv or libopenssl are not downloaded again. They are not listed by -Q. paku never replaces Git’s own runtime (msys2-runtime, bash, filesystem, pacman, mintty) and refuses them as explicit targets.

Configuration

Where files go

Files from ucrt64/..., clangarm64/... or usr/... in a package are installed under ~/.local, the usual per-user prefix (pip and Claude Code use it too):

In packageInstalled to
ucrt64/bin/rg.exe~/.local/bin/rg.exe
ucrt64/share/...~/.local/share/...
usr/lib/...~/.local/lib/...
etc/... (msys)~/.local/etc/...

Programs find their DLLs and data relative to their own location, so the tree keeps its shape.

paku’s own files:

PurposeDefaultOption
config~/.config/paku/paku.conf--config
databases~/.local/share/paku/db--dbpath
package cache~/.cache/paku/pkg--cachedir
keyring~/.local/share/paku/keyring--gpgdir
log~/.local/share/paku/paku.log--logfile

--root changes the install prefix; the databases and log then move to <root>/share/paku.

paku.conf

~/.config/paku/paku.conf is optional and uses pacman.conf syntax ([options], [repo] sections, Include, Server, IgnorePkg, NoExtract, NoUpgrade, ParallelDownloads, Color, …). paku adds these keys:

KeyMeaning
InstallPrefixinstall prefix, default ~/.local
EnvironmentMSYS2 environment, default ucrt64 (x64) or clangarm64 (ARM64)
GitRootGit for Windows directory, default found via git.exe on PATH

Example:

[options]
InstallPrefix = ~/.local
ParallelDownloads = 5
IgnorePkg = rsync
Color

Edited config files

paku never overwrites or deletes a package’s config file that you have edited, same as pacman:

WhenWhat happens
upgrade, and the package changed the file tooyour file stays; the new one is saved as .pacnew
upgrade, and the package did not change ityour file stays
removal (or the new version drops the file)your file is renamed to .pacsave; -Rn deletes it

Files matching NoUpgrade (paths relative to the install prefix, e.g. NoUpgrade = etc/foo.conf) are never replaced or removed; new versions are saved as .pacnew.

Signatures

paku -Sy downloads each repository’s <repo>.db.sig and checks it; paku -S checks every package’s signature after download and before anything is extracted. Signatures are checked against MSYS2’s keyring, which is built into paku. A database that fails the check is deleted, and a failing package stops the whole transaction:

error: msys: key "5F944B027F7FE2091985AA2EFA11531AA0AA7F57" is unknown
error: failed to update msys (invalid or corrupted database (PGP signature))

SigLevel works as in pacman.conf, in [options] or per repository. The default is Required for databases and packages, as in MSYS2’s own pacman.conf:

ValueEffect
Requiredevery database or package must have a valid signature
Optionalcheck signatures that exist; accept unsigned files
Neverdo not check signatures

Prefix a value with Package or Database to set only that part, e.g. SigLevel = Required DatabaseOptional. TrustedOnly and TrustAll are accepted and ignored: paku trusts every key in its keyring that is not revoked.

To use a newer MSYS2 keyring than the built-in one, put msys2.gpg and msys2-revoked from the msys2-keyring package into ~/.local/share/paku/keyring (GPGDir, --gpgdir).

Environment variables

VariableUsed for
HOMEhome directory; falls back to USERPROFILE
USERPROFILEhome directory when HOME is not a Windows path
PATHfinding Git for Windows via git.exe
COLUMNSoutput width
PAKU_VERSIONinstall.sh only: release to install, e.g. v0.1.0

Downloads use Windows’ built-in WinHTTP, so the system’s certificates and proxy settings apply.

Limitations

  • msys programs resolve absolute POSIX paths (/usr/share/..., /etc/...) against Git’s install directory, not ~/.local. Programs that need their data files there won’t find them; prefer mingw packages.
  • .pc files, *-config scripts and libtool .la files contain hardcoded /ucrt64 paths; paku does not rewrite them.
  • Install scriptlets (.INSTALL) are not run yet; paku prints a warning for packages that have one.
  • Not implemented yet: -U (install local package files), -D, -F, -Sc, and the -Q options -g, -k, -c, -p and -t.
  • Release binaries are not code-signed yet; Smart App Control may block them.