Skip to content

docs: Add step to install working version on Ubuntu Pro - #14373

Open
acoulton wants to merge 1 commit into
cli:trunkfrom
acoulton:patch-1
Open

acoulton wants to merge 1 commit into
cli:trunkfrom
acoulton:patch-1

Conversation

@acoulton

@acoulton acoulton commented Sep 7, 2026

Copy link
Copy Markdown

Description

The current install instructions do not work as expected with Ubuntu Pro at least on Ubuntu 24.04.4 LTS.

They appear to succeed, but are essentially a no-op: apt install gh behaves exactly the same as it would if the repo had never been added. The system installs a Ubuntu-maintained version of 2.45.0, and will never detect or install any newer version from the official GitHub repo.

This is because the gh package is present in the Ubuntu Enhanced Security Maintenance repo, and this has a higher pin priority than the GitHub repo.

This is exacerbated because 2.45.0 no longer actually works, due to later changes to the GitHub API.

Unless GitHub changes its packaging, the only workaround for this is for end-users to explicitly configure a preference for the GitHub repo.

How did you test this change?

  • In the past, I had followed the official install instructions before first installing gh. I can see that I have the keyring, sources.list.d/github-cli.list etc with the expected content.
  • I hit an error attempting to use gh this morning and identified that I was on v2.45.0
  • I checked the repo and saw that the latest version is v2.100.0.
  • I ran apt update - the first run (not in the screenshot below) failed due to the PGP rotation, but I fixed that without issues.
  • I ran apt update && apt install gh assuming this would now upgrade me. The GH repo was fetched without warnings, but apt install gh reported that there was no newer version to install.
  • I spent time googling / trying to find a solution. I found the advice / references below and added the preferences.d file as per this PR.
  • I ran apt update && apt install gh and have now successfully updated to v2.100.0 (the latest stable at time of writing)
gh-cli-install

Key points

Notes for reviewers

This problem, and the solution, was identified by multiple separate users in:

It is also covered in
https://lukemanning.ie/blog/gh-issue-view-failing-ubuntu-deprecation-apt-pin

It may also be related to some of the cases reported in #9280 (although different posters in that issue appear to have different issues).

Authorship and follow-up

Who wrote this:

  • A human wrote it.
  • An agent wrote it under close human direction.
  • An agent wrote it independently, and no human has guided the implementation beyond the initial prompt.

Who answers review comments:

  • @acoulton will read and reply directly. Name the account.
  • An agent will draft replies and @username will read them before they are posted.
  • Nobody has explicitly committed to replying.

test: Fix expected output for tagged example table

The current install instructions do not work as expected with Ubuntu Pro
at least on Ubuntu 24.04.4 LTS. 

They appear to succeed, but are essentially a no-op: `apt install gh` 
behaves exactly the same as it would if the repo had never been added.
The system installs a Ubuntu-maintained version of 2.45.0, and 
will never detect or install any newer version from the official GitHub 
repo.

This is because the `gh` package is present in the 
Ubuntu Enhanced Security Maintenance repo, and this has a higher pin 
priority than the GitHub repo.

This is exacerbated because 2.45.0 no longer actually works, due to 
later changes to the GitHub API.

Unless GitHub changes its packaging, the only workaround for this is for
end-users to explicitly configure a preference for the GitHub repo.

This was identified by multiple separate users in:

* cli#11992 (comment)
* cli#11992 (comment)
* cli#11992 (comment)

It is also covered in 
https://lukemanning.ie/blog/gh-issue-view-failing-ubuntu-deprecation-apt-pin

It may also be related to some of the cases reported in
cli#9280 (although different posters in 
that issue appear to have different issues).
@acoulton
acoulton requested a review from a team as a code owner September 7, 2026 10:43
@acoulton
acoulton requested a review from sergiou87 September 7, 2026 10:43
@github-actions github-actions Bot added external pull request originating outside of the CLI core team needs-triage needs to be reviewed ready-for-review and removed needs-triage needs to be reviewed labels Sep 7, 2026
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Thanks for your pull request! While it doesn't meet all of our standard requirements, it appears to be a small, focused contribution and has been routed to the team for review.

Note: We still encourage linking to an issue with the help wanted label when possible, as it helps us prioritize and track contributions.

@BagToad
BagToad requested a review from babakks September 7, 2026 13:43
gaurav added a commit to gaurav/prcoder that referenced this pull request Sep 16, 2026
The pane's one way out was GitHub's diff viewer, which is the same thing the
pane is already showing. What a patch cannot show is the file around it -- the
parts nobody touched, and a Markdown file rendered rather than as source -- so
the header carries both now: File ↗ for the file, Diff ↗ for the patch.

The file link is pinned to the PR's head commit, so it keeps saying what the
pane was showing after another push. One rule covers a fork's pull request too:
GitHub keeps an open PR's head in the base repository, checked against
cli/cli#14373 on 2026-09-16 and pinned in the test.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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 ready-for-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant