Tuesday, August 22, 2023
HomeProgrammingResolving "gh: command not discovered" or "gh isn't acknowledged" Errors

Resolving "gh: command not discovered" or "gh isn’t acknowledged" Errors


Introduction

Working right into a “gh: command not discovered” or “gh isn’t acknowledged” error message will be irritating. This usually happens when the GitHub CLI (gh) isn’t put in in your system or the trail to the executable isn’t accurately set.

On this Byte, we’ll stroll you thru the method of putting in GitHub CLI on Home windows and macOS utilizing totally different package deal managers.

There are loads of methods to do that between the varied working methods and package deal managers. I might recomment you take a look at the Desk of Contents on the appropriate to search out your OS and most well-liked installer to extra simply discover what you want.

For every of the set up strategies beneath, as soon as the set up completes, you may confirm that it put in accurately by working:

$ gh --version
gh model 1.14.0 (2021-04-19)

Set up GitHub CLI (gh) on Home windows by way of Chocolatey

Chocolatey is a package deal supervisor for Home windows. If you have not put in it but, you are able to do so by following the directions on the official Chocolatey web site. Upon getting Chocolatey put in, open your command immediate as an administrator and run the next command:

$ choco set up gh

Set up GitHub CLI (gh) on Home windows by way of Scoop

Scoop is one other package deal supervisor for Home windows. If you do not have Scoop put in, you may comply with the directions on the official Scoop web site to put in it. As soon as Scoop is put in, open your command immediate and run the next command:

$ scoop set up gh

Set up GitHub CLI (gh) on Home windows by way of WinGet

WinGet is a package deal supervisor that comes with Home windows 10. You’ll be able to set up GitHub CLI utilizing WinGet by opening your command immediate as an administrator and working the next command:

$ winget set up gh

Word: If you’re utilizing an older model of Home windows, WinGet might not be accessible. In that case, think about using Chocolatey or Scoop.

Set up GitHub CLI (gh) on macOS by way of Brew

Homebrew, sometimes called Brew, is a well-liked package deal supervisor for macOS. If you have not put in it but, you are able to do so by following the directions on the official Homebrew web site. Upon getting Brew put in, open your terminal and run the next command:

$ brew set up gh

Set up GitHub CLI (gh) on macOS by way of MacPorts

To put in the GitHub CLI (gh) on macOS utilizing MacPorts, you first want to make sure that you could have MacPorts put in in your system. If not, you may set up it from the MacPorts web site. As soon as MacPorts is put in, you may set up the GitHub CLI by working the next command in your terminal:

$ sudo port set up gh

This command will obtain and set up the GitHub CLI in your system.

Set up GitHub CLI (gh) on macOS by way of Spack

Spack is one other package deal supervisor for macOS that you should use to put in the GitHub CLI. To put in Spack, comply with the directions on the official Spack web site. After putting in Spack, you may set up the GitHub CLI by working:

$ spack set up gh

Set up GitHub CLI (gh) utilizing Anaconda

Anaconda is a well-liked Python distribution that features a package deal supervisor referred to as conda. You should utilize conda to put in the GitHub CLI. First, guarantee that you’ve Anaconda put in in your system. If not, obtain and set up it from the Anaconda web site. As soon as Anaconda is put in, open the Anaconda Immediate and run:

$ conda set up -c conda-forge gh

This command will set up the GitHub CLI.

Set up GitHub CLI (gh) on Debian, Ubuntu, Raspberry Pi OS

To put in the GitHub CLI on a Debian-based system like Debian, Ubuntu, or Raspberry Pi OS, you should use the apt package deal supervisor. First, replace your package deal lists by working:

$ sudo apt replace

Then, set up the GitHub CLI by working:

$ sudo apt set up gh

Set up GitHub CLI (gh) on Fedora, CentOS and Crimson Hat

On Fedora, CentOS, and Crimson Hat, you should use the dnf package deal supervisor to put in the GitHub CLI. First, replace your system by working:

$ sudo dnf replace

Then, set up the GitHub CLI by working:

$ sudo dnf set up gh

Word: The precise command to put in the GitHub CLI might differ barely relying in your particular Linux distribution and model.

Set up GitHub CLI (gh) on Amazon Linux 2 (yum)

To put in GitHub CLI on Amazon Linux 2, we’ll use yum, which is the default package deal supervisor for this distribution. First, let’s replace the system packages utilizing the next command:

$ sudo yum replace -y

Subsequent, we have to obtain the GitHub CLI rpm package deal. You’ll be able to all the time discover the newest model on the GitHub CLI releases web page. As of scripting this information, the newest model is 1.14.0. Substitute the model within the command beneath if a more recent model is obtainable:

$ wget https://github.com/cli/cli/releases/obtain/v1.14.0/gh_1.14.0_linux_amd64.rpm

Then, set up the downloaded package deal utilizing yum:

$ sudo yum localinstall gh_1.14.0_linux_amd64.rpm

Set up GitHub CLI (gh) on openSUSE/SUSE Linux with zypper

For openSUSE/SUSE Linux, we’ll use zypper to put in GitHub CLI. Begin by updating your system packages:

$ sudo zypper refresh

Subsequent, add the GitHub CLI repository to your system:

$ sudo zypper addrepo https://cli.github.com/packages/rpm/gh-cli.repo

Now, you may set up gh utilizing zypper:

$ sudo zypper set up gh

Word: Remember to exchange 1.14.0 with the newest model accessible on the time of your set up.

Conclusion

On this information, we have lined set up the GitHub CLI on fairly a number of working methods / distros and package deal managers, like Home windows, macOS, Debian and brew, port, choco, yum, and so on. With these steps, you must have the ability to repair the “gh: command not discovered” or “gh isn’t acknowledged” errors. Bear in mind to all the time confirm your installations by checking the model of your put in packages.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments