Created
March 9, 2026 03:21
-
-
Save nine1one/0de644ac05a23ce4548e77fc62e5a8f3 to your computer and use it in GitHub Desktop.
A script to install gh in linux.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Gist: Install GitHub CLI (gh) on Kali Linux | |
| set -e | |
| # Update package lists | |
| sudo apt update | |
| # Install dependencies | |
| sudo apt install -y curl gnupg2 | |
| # Add GitHub CLI GPG key | |
| curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg | |
| # Add GitHub CLI repository | |
| 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 | |
| # Update package lists again | |
| sudo apt update | |
| # Install GitHub CLI | |
| sudo apt install -y gh | |
| # Verify installation | |
| gh --version | |
| # Authenticate GitHub CLI | |
| gh auth login |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment