github.com/andrewhsu/cli/v2@v2.0.1-0.20210910131313-d4b4061f5b89/docs/install_linux.md (about)

     1  # Installing gh on Linux and BSD
     2  
     3  Packages downloaded from https://cli.github.com or from https://github.com/cli/cli/releases
     4  are considered official binaries. We focus on popular Linux distros and
     5  the following CPU architectures: `i386`, `amd64`, `arm64`, `armhf`.
     6  
     7  Other sources for installation are community-maintained and thus might lag behind
     8  our release schedule.
     9  
    10  ## Official sources
    11  
    12  ### Debian, Ubuntu Linux, Raspberry Pi OS (apt)
    13  
    14  Install:
    15  
    16  ```bash
    17  curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg
    18  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
    19  sudo apt update
    20  sudo apt install gh
    21  ```
    22  
    23  **Note**: If you get the error _"gpg: failed to start the dirmngr '/usr/bin/dirmngr': No such file or directory"_, try installing the `dirmngr` package: `sudo apt install dirmngr`.
    24  
    25  Upgrade:
    26  
    27  ```bash
    28  sudo apt update
    29  sudo apt install gh
    30  ```
    31  
    32  ### Fedora, CentOS, Red Hat Enterprise Linux (dnf)
    33  
    34  Install:
    35  
    36  ```bash
    37  sudo dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
    38  sudo dnf install gh
    39  ```
    40  
    41  Upgrade:
    42  
    43  ```bash
    44  sudo dnf update gh
    45  ```
    46  
    47  ### openSUSE/SUSE Linux (zypper)
    48  
    49  Install:
    50  
    51  ```bash
    52  sudo zypper addrepo https://cli.github.com/packages/rpm/gh-cli.repo
    53  sudo zypper ref
    54  sudo zypper install gh
    55  ```
    56  
    57  Upgrade:
    58  
    59  ```bash
    60  sudo zypper ref
    61  sudo zypper update gh
    62  ```
    63  
    64  ## Manual installation
    65  
    66  * [Download release binaries][releases page] that match your platform; or
    67  * [Build from source](./source.md).
    68  
    69  ## Unofficial, community-supported methods
    70  
    71  The GitHub CLI team does not maintain the following packages or repositories and thus we are unable to provide support for those installation methods.
    72  
    73  ### Snap (do not use)
    74  
    75  There are [so many issues with Snap](https://github.com/casperdcl/cli/issues/7) as a runtime mechanism for apps like GitHub CLI that our team suggests _never installing gh as a snap_.
    76  
    77  ### Arch Linux
    78  
    79  Arch Linux users can install from the [community repo][arch linux repo]:
    80  
    81  ```bash
    82  sudo pacman -S github-cli
    83  ```
    84  
    85  Alternatively, use the [unofficial AUR package][arch linux aur] to build GitHub CLI from source.
    86  
    87  ### Android
    88  
    89  Android 7+ users can install via [Termux](https://wiki.termux.com/wiki/Main_Page):
    90  
    91  ```bash
    92  pkg install gh
    93  ```
    94  
    95  ### FreeBSD
    96  
    97  FreeBSD users can install from the [ports collection](https://www.freshports.org/devel/gh/):
    98  
    99  ```bash
   100  cd /usr/ports/devel/gh/ && make install clean
   101  ```
   102  
   103  Or via [pkg(8)](https://www.freebsd.org/cgi/man.cgi?pkg(8)):
   104  
   105  ```bash
   106  pkg install gh
   107  ```
   108  
   109  ### OpenBSD
   110  
   111  In -current, or in releases starting from 7.0, OpenBSD users can install from packages:
   112  
   113  ```
   114  pkg_add github-cli
   115  ```
   116  
   117  ### Funtoo
   118  
   119  Funtoo Linux has an autogenerated github-cli package, located in [dev-kit](https://github.com/funtoo/dev-kit/tree/1.4-release/dev-util/github-cli), which can be installed in the following way:
   120  
   121  ``` bash
   122  emerge -av github-cli
   123  ```
   124  
   125  Upgrading can be done by syncing the repos and then requesting an upgrade:
   126  
   127  ``` bash
   128  ego sync
   129  emerge -u github-cli
   130  ```
   131  
   132  ### Gentoo
   133  
   134  Gentoo Linux users can install from the [main portage tree](https://packages.gentoo.org/packages/dev-util/github-cli):
   135  
   136  ``` bash
   137  emerge -av github-cli
   138  ```
   139  
   140  Upgrading can be done by updating the portage tree and then requesting an upgrade:
   141  
   142  ``` bash
   143  emerge --sync
   144  emerge -u github-cli
   145  ```
   146  
   147  ### Kiss Linux
   148  
   149  Kiss Linux users can install from the [community repos](https://github.com/kisslinux/community):
   150  
   151  ```bash
   152  kiss b github-cli && kiss i github-cli
   153  ```
   154  
   155  ### Nix/NixOS
   156  
   157  Nix/NixOS users can install from [nixpkgs](https://search.nixos.org/packages?show=gitAndTools.gh&query=gh&from=0&size=30&sort=relevance&channel=20.03#disabled):
   158  
   159  ```bash
   160  nix-env -iA nixos.gitAndTools.gh
   161  ```
   162  
   163  ### openSUSE Tumbleweed
   164  
   165  openSUSE Tumbleweed users can install from the [official distribution repo](https://software.opensuse.org/package/gh):
   166  ```bash
   167  sudo zypper in gh
   168  ```
   169  
   170  [releases page]: https://github.com/cli/cli/releases/latest
   171  [arch linux repo]: https://www.archlinux.org/packages/community/x86_64/github-cli
   172  [arch linux aur]: https://aur.archlinux.org/packages/github-cli-git