Installing gh-cli

I attempt top install gh with sudo dnf install gh --repo gh-cli

This results in:


Problem: conflicting requests
  - nothing provides git needed by gh-2.87.3-1.i386 from gh-cli
  - nothing provides git needed by gh-2.87.3-1.x86_64 from gh-cli
  - package gh-2.87.3-1.aarch64 from gh-cli does not have a compatible architecture
  - nothing provides git needed by gh-2.87.3-1.aarch64 from gh-cli
  - package gh-2.87.3-1.armv6hl from gh-cli does not have a compatible architecture
  - nothing provides git needed by gh-2.87.3-1.armv6hl from gh-cli

Yet git is installed:


$ git --version
git version 2.53.0
$ whereis git
git: /usr/bin/git

Why isn´t dnf able to locate the git installation?

uname -m ?

$ rpm -qa git\*
git-core-2.53.0-1.fc43.x86_64
git-core-doc-2.53.0-1.fc43.noarch
git-2.53.0-1.fc43.x86_64

# dnf in gh
Updating and loading repositories:
Repositories loaded.
Package                                   Arch        Version                                    Repository                 Size
Installing:
 gh                                       x86_64      2.87.0-2.fc43                              updates                37.6 MiB

# dnf in https://kojipkgs.fedoraproject.org//packages/gh/2.87.3/1.fc43/x86_64/gh-2.87.3-1.fc43.x86_64.rpm
Updating and loading repositories:
Repositories loaded.
 https://kojipkgs.fedoraproject.org//packages/gh/2.87.3/1.fc43/x86_64/gh-2.87.3-1.fc43. 100% |   4.1 MiB/s |  10.9 MiB |  00m03s
Package                                   Arch       Version                                    Repository                  Size
Installing:
 gh                                       x86_64     2.87.3-1.fc43                              @commandline            37.6 MiB

Transaction Summary:
 Installing:         1 package

Using --repo gh-cli means “enable only the gh-cli repository, and no others”.

Maybe you meant to do --enablerepo gh-cli instead?

Side note: gh is also packaged for Fedora, I don’t think you should need a third-party repository (assuming that the gh you’re installing from there is actually also the GitHub command-line client and not something different with the same name).

I mean to follow the instructions GitHub - cli/cli: GitHub’s official command line tool gave me.

But I better file an issue with them.

Yeah. The “official” install instructions here are wrong:

https://github.com/cli/cli/blob/trunk/docs/install_linux.md#dnf5

Though the “community” instructions further down are correct :slight_smile:

https://github.com/cli/cli/blob/trunk/docs/install_linux.md#fedora-community

Note that the repository contains enabled=1 so the --repo gh-cli / --enablerepo gh-cli arguments are entirely unnecessary, as well.

2 Likes

should not be an issue if git is already installed, though

# rpm -qa git\*
git-core-2.53.0-1.fc43.x86_64
git-core-doc-2.53.0-1.fc43.noarch
git-2.53.0-1.fc43.x86_64

# dnf install gh --repo gh-cli
Updating and loading repositories:
Repositories loaded.
Package                      Arch     Version                      Repository           Size
Installing:
 gh                          x86_64   2.87.3-1                     gh-cli           36.7 MiB

Transaction Summary:
 Installing:         1 package
1 Like

it was an issue, hence this post. gh was not installed due to it.

How did you install git? From the normal Fedora repos?

How would I know that?

I agree . it is though.

that ofcourse is very cool. How would I know such things?

You should be able to see what repo it came from by doing:

dnf list --installed git

For example I see:

git.x86_64 2.53.0-1.fc43 updates

The last column is the name of the repo (“updates” in my case, i.e. Fedora’s repo for post-release updates).

It would also be interesting to see the output of:

dnf repoquery --installed --whatprovides git

…which asks the question "what installed package provides the capability called git "?

The error messages you are getting (“nothing provides git…”) suggests that dnf is not finding that capability.