Skip to content

fix(docs): use --enablerepo for Fedora dnf install instructions - #13268

Closed
Bojun-Vvibe wants to merge 2 commits into
cli:trunkfrom
Bojun-Vvibe:fix/cli-cli-12808
Closed

Bojun-Vvibe wants to merge 2 commits into
cli:trunkfrom
Bojun-Vvibe:fix/cli-cli-12808

Conversation

@Bojun-Vvibe

Copy link
Copy Markdown

Closes #12808

Repo

cli/cli

Issue

#12808

Root cause

The Fedora install instructions in docs/install_linux.md told users to run
sudo dnf install gh --repo gh-cli. The --repo/--repoid flag restricts
dnf to ONLY the listed repository, so dnf cannot resolve gh's dependency
on git (which lives in Fedora's default repos), producing
"nothing provides git needed by gh-..." errors.

Fix

Replace --repo gh-cli with --enablerepo gh-cli in both the DNF5 and DNF4
install snippets. --enablerepo additively enables the gh-cli repository
while keeping the default Fedora repositories available, allowing dnf to
satisfy the git dependency. This matches the workaround the reporter
confirmed works.

Regression test

None added: the change is documentation-only (Markdown install instructions
in docs/install_linux.md); there is no automated test harness in the repo
that exercises rendered install commands. A code regression test would not
meaningfully cover this docs string.

Risk

trivial

Verification

skipped: docs-only change; verified by inspecting the diff and dnf flag
semantics (--repo is exclusive, --enablerepo is additive). No Go code
paths touched, so go test/make lint are not relevant to the change.

The previous --repo gh-cli flag restricts dnf to ONLY the gh-cli
repository, which causes 'nothing provides git' resolution failures
because git lives in the default Fedora repos. Switching to
--enablerepo gh-cli additively enables the new repo while keeping
the default repos available for dependency resolution.
@github-actions github-actions Bot added external pull request originating outside of the CLI core team needs-triage needs to be reviewed labels Apr 23, 2026
@Bojun-Vvibe
Bojun-Vvibe marked this pull request as ready for review April 24, 2026 15:24
@Bojun-Vvibe
Bojun-Vvibe requested a review from a team as a code owner April 24, 2026 15:24

@williammartin williammartin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this gets us anything because our repo file already has enabled=1:

[gh-cli]
name=packages for the GitHub CLI
baseurl=https://cli.github.com/packages/rpm
enabled=1
gpgcheck=1
gpgkey=https://cli.github.com/packages/githubcli-archive-keyring.asc

I think most likely we can just remove the --repo flag altogether since the official repositories are stuck on such an old version. I just don't have a fedora box to verify right now CC @babakks

@williammartin williammartin removed the needs-triage needs to be reviewed label Apr 28, 2026
The repo file installed by config-manager already has enabled=1, so
neither --repo nor --enablerepo is necessary. Removing the flag
altogether matches the official package repository's enabled-by-default
state.

Signed-off-by: Bojun Chai <bojunchai@microsoft.com>
@Bojun-Vvibe

Copy link
Copy Markdown
Author

Thanks @williammartin — good point. Pushed 5ef2645 which drops the --repo gh-cli flag entirely from both Fedora install snippets (dnf5 and dnf4). The repo file installed by config-manager already sets enabled=1, so no opt-in flag is needed. Happy to revert to --enablerepo if @babakks confirms a Fedora box where the bare dnf install gh doesn't pick up the repo.

@Bojun-Vvibe

Copy link
Copy Markdown
Author

@williammartin good catch — the current diff actually already does exactly that (drops --repo gh-cli on both the DNF5 and DNF4 instructions); the PR title is stale from an earlier draft. Want me to also update the title to something like docs(install): drop redundant --repo gh-cli on Fedora dnf install?

@williammartin
williammartin self-requested a review May 13, 2026 18:21
XavierMP14

This comment was marked as spam.

@babakks

babakks commented May 18, 2026

Copy link
Copy Markdown
Member

Yeah, I think we should just close this PR. I've already merged #13444 which fixes the issue with installing dependencies (i.e. git).

@babakks babakks closed this May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external pull request originating outside of the CLI core team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Instruction for fedora fail

5 participants