(From cli/cli)
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.
Other sources for installation are community-maintained and thus might lag behind our release schedule.
If none of our official binaries, packages, repositories, nor community sources work for you, we recommend using our Makefile to build gh from source. It's quick and easy.
Install (Using apt-key):
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
sudo apt-add-repository https://cli.github.com/packages
sudo apt update
sudo apt install ghNote: If you are behind a firewall, the connection to keyserver.ubuntu.com might fail. In that case, try running sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key C99B11DEB97541F0.
Note: If you get "gpg: failed to start the dirmngr '/usr/bin/dirmngr': No such file or directory" error, try installing the dirmngr package. Run sudo apt-get install dirmngr and repeat the steps above.
Note: most systems will have apt-add-repository already. If you get a command not found
error, try running sudo apt install software-properties-common and trying these steps again.
Install (without add-apt-repository, with limited keyring scope):
sudo apt-key --keyring /usr/share/keyrings/githubcli-archive-keyring.gpg adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/github-cli2.list > /dev/null
sudo apt update
sudo apt install ghUpgrade:
sudo apt update
sudo apt install ghInstall:
sudo dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
sudo dnf install ghUpgrade:
sudo dnf 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.
Install and upgrade:
- Download the
.rpmfile from the releases page; - Install the downloaded file:
sudo zypper in gh_*_linux_amd64.rpm
The core GitHub CLI team does not maintain the following packages or repositories. They are unofficial and we are unable to provide support or guarantees for them. They are linked here as a convenience and their presence does not imply continued oversight from the CLI core team. Users who choose to use them do so at their own risk.
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 ghLinuxbrew users can install it as a brew package:
brew install ghFreeBSD users can install from the ports collection:
cd /usr/ports/devel/gh/ && make install cleanOr via pkg(8):
pkg install ghFuntoo 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.gitAndTools.ghopenSUSE Tumbleweed users can install from the offical distribution repo:
sudo zypper in ghMany Linux distro users can install using Snapd from the Snap Store or the associated repo
sudo snap install --edge gh && snap connect gh:ssh-keysSnaps are auto-updated every 6 hours.
Snapdis required and is available on a wide range of Linux distros. Find out which distros have Snapd pre-installed and how to install it in the Snapcraft Installation DocsNote:
snap connect gh:ssh-keysis needed for all authentication and SSH needs.