Packages downloaded from https://cli.github.com or from https://github.com/cli/cli/releases
are considered official binaries. We focus on popular Linux distros and
the following CPU architectures: i386, amd64, arm64, armhf.
Other sources for installation are community-maintained and thus might lag behind our release schedule.
Install:
type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y)
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/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 -yNote We were recently forced to change our GPG signing key. If you've previously downloaded the
githubcli-archive-keyring.gpgfile, you should re-download it again per above instructions. If you are using a keyserver to download the key, the ID of the new key is23F3D4EA75716059.
Upgrade:
sudo apt update
sudo apt install ghInstall from our package repository for immediate access to latest releases:
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 ghAlternatively, install from the community repository:
sudo dnf install ghUpgrade:
sudo dnf update ghInstall using our package repository for immediate access to latest releases:
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 ghNote We were recently forced to change our GPG signing key. If you've added the repository previously and now you're getting a GPG signing key error, disable the repository first with
sudo yum-config-manager --disable gh-cliand add it again withsudo yum-config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo.
Upgrade:
sudo yum update ghInstall:
sudo zypper addrepo https://cli.github.com/packages/rpm/gh-cli.repo
sudo zypper ref
sudo zypper install ghUpgrade:
sudo zypper ref
sudo zypper update gh- Download release binaries that match your platform; or
- Build from source.
The GitHub CLI team does not maintain the following packages or repositories and thus we are unable to provide support for those installation methods.
There are so many issues with Snap as a runtime mechanism for apps like GitHub CLI that our team suggests never installing gh as a snap.
Arch Linux users can install from the community repo:
sudo pacman -S github-cliAlternatively, use the unofficial AUR package to build GitHub CLI from source.
Android 7+ users can install via Termux:
pkg install ghFreeBSD users can install from the ports collection:
cd /usr/ports/devel/gh/ && make install cleanOr via pkg(8):
pkg install ghNetBSD users and those on platforms supported by pkgsrc can install the gh package:
pkgin install ghTo install from source:
cd /usr/pkgsrc/net/gh && make package-installIn -current, or in releases starting from 7.0, OpenBSD users can install from packages:
pkg_add github-cli
Funtoo Linux has an autogenerated github-cli package, located in dev-kit, which can be installed in the following way:
emerge -av github-cliUpgrading can be done by syncing the repos and then requesting an upgrade:
ego sync
emerge -u github-cliGentoo Linux users can install from the main portage tree:
emerge -av github-cliUpgrading can be done by updating the portage tree and then requesting an upgrade:
emerge --sync
emerge -u github-cliKiss Linux users can install from the community repos:
kiss b github-cli && kiss i github-cliNix/NixOS users can install from nixpkgs:
nix-env -iA nixos.ghopenSUSE Tumbleweed users can install from the official distribution repo:
sudo zypper in ghAlpine Linux users can install from the stable releases' community package repository.
apk add github-cliUsers wanting the latest version of the CLI without waiting to be backported into the stable release they're using should use the edge release's community repo through this method below, without mixing packages from stable and unstable repos.1
echo "@community http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
apk add github-cli@communityVoid Linux users can install from the official distribution repo:
sudo xbps-install github-cli