Skip to content
Latchkey

yq: Install on a CI Runner (snap vs binary)

The reliable way to get mikefarah/yq on a runner is its static GitHub release binary; snap, apt, and pip can give you the wrong tool or a sandboxed one.

Half of yq problems in CI are install problems: the binary is missing, or the package manager installed the Python yq, or snap sandboxed it away from your files. Pin the release binary.

What it does

mikefarah/yq ships as a single static binary per platform on its GitHub releases page. Downloading it directly gives a known version with the Go syntax. pip install yq installs the unrelated Python tool; some distro packages and snap may install either, and snap confinement can block file access.

Common usage

Terminal
# install the Go yq release binary (Linux amd64)
sudo wget -qO /usr/local/bin/yq \
  https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
sudo chmod +x /usr/local/bin/yq
yq --version   # expect: ... mikefarah ... v4.x

Install methods

MethodWhat you get
GitHub release binarymikefarah/yq, pinned, recommended
snap install yqmikefarah/yq but confined (file access issues)
pip install yqkislyuk/yq (Python, wrong syntax for Go scripts)
apt/brew install yqVaries by distro; verify with --version
Docker mikefarah/yqGo yq in a container, mount your files in

In CI

On GitHub Actions, ubuntu-latest already ships mikefarah/yq, so no install step is needed there. On minimal or self-managed runners, download the release binary to a PATH directory rather than relying on the package manager, and pin a version tag for reproducibility.

Common errors in CI

"yq: command not found" means yq is not installed or not on PATH; add the install step or check the PATH. snap-installed yq hitting "permission denied" or "cannot open" on files outside $HOME is snap confinement; use the release binary instead. If yq is present but your = and -i edits do nothing, pip installed the Python yq; reinstall the Go binary and confirm with yq --version.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →