Debian packages are hosted on the GitHub CLI marketing site for various operating systems including:
These packages are supported by the GitHub CLI maintainers with updates powered by GitHub CLI deployment workflow.
To install:
(type -p wget >/dev/null || (sudo apt update && sudo apt install wget -y)) \
&& sudo mkdir -p -m 755 /etc/apt/keyrings \
&& out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \
&& cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
&& sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
&& sudo mkdir -p -m 755 /etc/apt/sources.list.d \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -yTo upgrade:
sudo apt update
sudo apt install ghRPM packages are hosted on the GitHub CLI marketing site for various operating systems including:
These packages are supported by the GitHub CLI maintainers with updates powered by GitHub CLI deployment workflow.
Important
These commands apply to DNF5 only. If you're using DNF4, please use the DNF4 instructions.
To install:
sudo dnf install dnf5-plugins
sudo dnf config-manager addrepo --from-repofile=https://cli.github.com/packages/rpm/gh-cli.repo
sudo dnf install gh --repo gh-cliTo upgrade:
sudo dnf update ghImportant
These commands apply to DNF4 only. If you're using DNF5, please use the DNF5 instructions.
To install:
sudo dnf install 'dnf-command(config-manager)'
sudo dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
sudo dnf install gh --repo gh-cliTo upgrade:
sudo dnf update ghTo install:
type -p yum-config-manager >/dev/null || sudo yum install yum-utils
sudo yum-config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
sudo yum install ghTo upgrade:
sudo yum update ghTo install:
sudo zypper addrepo https://cli.github.com/packages/rpm/gh-cli.repo
sudo zypper ref
sudo zypper install ghTo upgrade:
sudo zypper ref
sudo zypper update ghHomebrew is a free and open-source software package management system that simplifies the installation of software on Apple's operating system, macOS, as well as Linux.
The GitHub CLI formulae is supported by the GitHub CLI maintainers with help from our friends at Homebrew with updated powered by homebrew/hoomebrew-core.
To install:
brew install ghTo upgrade:
brew upgrade ghGitHub CLI releases contain precompiled binaries for 386, amd64, arm64, and armv6 architectures.
Important
The GitHub CLI team does not maintain the following packages or repositories. We are unable to provide support for these installation methods or any guarantees of stability, security, or availability for these installation methods.
The GitHub CLI package is supported by the Alpine Linux community with updates powered by alpine/aports.
To install stable release:
apk add github-cliTo install edge release:
echo "@community http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
apk add github-cli@communityThe GitHub CLI package is supported by the Termux community with updates powered by termux/termux-packages.
To install and upgrade:
pkg install ghThe GitHub CLI package is supported by the Arch Linux community with updates powered by Arch Linux packaging.
To install:
sudo pacman -S github-cliTo upgrade all packages:
sudo pacman -SyuAlternatively, use the unofficial AUR package to build GitHub CLI from source.
Conda is an open source package management system and environment management system for installing multiple versions of software packages and their dependencies and switching easily between them. It works on Linux, OS X and Windows, and was created for Python programs but can package and distribute any software.
The GitHub CLI package is supported by the Conda community with updates powered by conda-forge/gh-feedstock.
To install:
conda install gh --channel conda-forgeTo upgrade:
conda update gh --channel conda-forgeThe GitHub CLI package is supported by the Debian community with updates powered by Debian Go Packaging Team.
Note
As of November 2025, GitHub CLI maintainers strongly recommend official Debian packages especially as the community-distributed 2.45.x / 2.46.x version is broken due to deprecated GitHub APIs.
The GitHub CLI package is supported by the Fedora community with updates powered by Fedora Project.
To install:
sudo dnf install ghTo upgrade:
sudo dnf update ghFlox is a virtual environment and package manager all in one. With Flox you create environments that layer and replace dependencies just where it matters, making them portable across the full software lifecycle.
Flox relies upon the GitHub CLI package supported by the NixOS community
To install:
flox install ghTo upgrade:
flox upgrade toplevelThe GitHub CLI port is supported by the FreeBSD community with updates powered by FreeBSD ports.
cd /usr/ports/devel/gh/ && make install cleanOr via pkg(8):
pkg install ghThe GitHub CLI portage is supported by the Funtoo community with updates powered by funtoo/dev-kit.
To install:
emerge -av github-cliTo upgrade:
ego sync
emerge -u github-cliThe GitHub CLI portage is supported by the Gentoo community with updates powered by Gentoo portage.
To install:
emerge -av github-cliTo upgrade:
emerge --sync
emerge -u github-cliThe GitHub CLI package is the same package produced by the Arch Linux community
To install and upgrade:
pamac install github-cliThe GitHub CLI port is supported by the MidnightBSD community with updates powered by MidnightBSD/mports.
To install:
cd /usr/mports/devel/gh/ && make install cleanOr via mport(1):
mport install ghThe GitHub CLI package is supported by the NetBSD community with updates powered by NetBSD/pkgsrc.
To install:
pkgin install ghThe GitHub CLI package is supported by the NixOS community with updates powered by NixOS/nixpkgs.
To install:
nix-env -iA nixos.ghThe GitHub CLI port is supported by the OpenBSD community with updates powered by OpenBSD ports.
To install:
pkg_add github-cliThe GitHub CLI package is supported by the openSUSE community.
To install:
sudo zypper install ghTo upgrade:
sudo zypper update ghThe GitHub CLI package is supported by the Solus Linux community with updates powered by getsolus/packages.
To install:
sudo eopkg install github-cliSpack is a flexible package manager supporting multiple versions, configurations, platforms, and compilers for supercomputers, Linux, and macOS.
The GitHub CLI package is supported by the Spack community with updates powered by spack/spack-packages.
To install:
spack install ghTo upgrade:
spack uninstall gh && spack install ghThe GitHub CLI package is synced from upstream Debian Community package.
Note
As of November 2025, GitHub CLI maintainers strongly recommend official Debian packages especially as the community-distributed 2.45.x / 2.46.x version is broken due to deprecated GitHub APIs.
The GitHub CLI package: is supported by the Void Linux community with updates powered by void-linux/void-packages.
To install:
sudo xbps-install github-cliWebi is a tool that aims to effortlessly install developer tools with easy-to-remember URLs from official builds quickly, without sudo or Admin, without a package manager, and without changing system file permissions.
The GitHub CLI package is supported by the Webi community with updates powered by webinstall/webi-installers.
To install:
curl -sS https://webi.sh/gh \| shTo upgrade:
webi gh@stableWarning
The GitHub CLI team actively discourages use of the following methods of installation.
The GitHub CLI package has so many issues with Snap as a runtime mechanism for apps like GitHub CLI that our team suggests never installing gh as a snap.