apt fails to check gh cli repo · Issue #9280 · cli/cli · GitHub
Skip to content

apt fails to check gh cli repo #9280

Closed as not planned
Closed as not planned

Description

@splaisan

(ubuntu 22 using apt - system up-to-date)

similar to previous (solved) issue but the fix proposed there does not fix here nor does the instructions found on https://github.com/cli/cli#installation as seen below
deinstalling then reinstalling also does not fix
thanks for your help

$ (type -p wget >/dev/null || (sudo apt update && sudo apt-get install wget -y)) \
&& sudo mkdir -p -m 755 /etc/apt/keyrings \
&& wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
&& sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y
Hit:2 https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/ InRelease                                                                                                                   
Ign:3 https://cli.github.com/packages jammy InRelease                                                                                                                                        
Hit:4 https://download.docker.com/linux/ubuntu focal InRelease                                                                                                                               
Hit:5 https://packages.wazuh.com/4.x/apt stable InRelease                                                                                                                                    
Hit:6 https://cli.github.com/packages stable InRelease                                                                                                                                       
Err:7 https://cli.github.com/packages jammy Release                                                                                                                                          
  404  Not Found [IP: 185.199.111.153 443]
Hit:8 https://packages.cloud.google.com/apt cloud-sdk InRelease                                                                                                                              
Hit:1 https://packages.icinga.com/ubuntu icinga-focal InRelease                                                                                                                              
Hit:9 http://apt.puppetlabs.com stretch InRelease                                         
Hit:10 http://be.archive.ubuntu.com/ubuntu jammy InRelease          
Hit:11 http://be.archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:13 http://be.archive.ubuntu.com/ubuntu jammy-backports InRelease     
Hit:14 http://be.archive.ubuntu.com/ubuntu jammy-security InRelease      
Hit:12 https://linux.dell.com/repo/community/openmanage/950/focal focal InRelease
Reading package lists... Done
E: The repository 'https://cli.github.com/packages jammy Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

Activity

  1. changed the title [-]apt fails to check gh repo[/-] [+]apt fails to check gh cli repo[/+] on Jul 3, 2024
  2. edelmoral commented on Sep 7, 2024

    @edelmoral

    I am in Venezuela and https://cli.github.com isn't accesible from here. My issue was solved by using a VPN.

  3. davhdavh commented on Oct 11, 2024

    @davhdavh

    for anyone else that gets this error, you can install latest via:

    curl -LO https://github.com/cli/cli/releases/latest/download/gh_$(curl -s https://api.github.com/repos/cli/cli/releases/latest | grep -Po '"tag_name": "v\K[0-9.]+')_linux_amd64.deb
    dpkg -i gh_*_linux_amd64.deb
    rm -rf gh_*_linux_amd64.deb
  4. williammartin commented on Dec 2, 2024

    @williammartin
    Member

    I'm not really sure why your lookup is going to:

    E: The repository 'https://cli.github.com/packages jammy Release' does not have a Release file.
    

    As per our installation instructions and your command, it should be looking for stable:

    deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main
    

    We don't ship a jammy release for reasons that were mentioned here: #5523 (comment)

    You might want to:

    cat /etc/apt/sources.list.d/github-cli.list
    

    And have a look to see that there isn't any mention of jammy in there.

  5. ShwetanshSingh commented on Jun 27, 2025

    @ShwetanshSingh

    The files are missing on my system @williammartin.
    cat: /etc/apt/sources.list.d/github-cli.list: No such file or directory
    Instead I have the following files,

     $ ls /etc/apt/sources.list.d/
    archive_uri-https_cli_github_com_packages-noble.list
    ubuntu.sources
    
    $ cat /etc/apt/sources.list.d/archive_uri-https_cli_github_com_packages-noble.list
    deb https://cli.github.com/packages noble main
    # deb-src https://cli.github.com/packages noble main
    

    I am using Ubuntu 24.04.2

    $ gh --version
    gh version 2.45.0 (2024-11-01 Ubuntu 2.45.0-1ubuntu0.2)
    https://github.com/cli/cli/releases/tag/v2.45.0
    

    Can I provide any more information?

  6. williammartin commented on Jun 27, 2025

    @williammartin
    Member

    You have 2.45.0 because that's the version of noble that ubuntu ships by default I'd guess: https://launchpad.net/ubuntu/noble/+source/gh

    I'm not sure what you need to do to reorder priorities. I would expect that the instructions https://github.com/cli/cli/blob/trunk/docs/install_linux.md#debian-ubuntu-linux-raspberry-pi-os-apt would work. Can you share the output when you try those commands?

  7. williammartin commented on Jun 27, 2025

    @williammartin
    Member

    I suspect the answer is that there are some leftover list files and if you had a look in sudo nano /etc/apt/sources.list.d/github-cli.list or /etc/apt/sources.list.d/github-cli*.list.d/*jammy*.list you would find that you need to remove jammy (or noble) and replace with stable. Just a hunch though.

  8. ShwetanshSingh commented on Jul 7, 2025

    @ShwetanshSingh

    You have 2.45.0 because that's the version of noble that ubuntu ships by default I'd guess: https://launchpad.net/ubuntu/noble/+source/gh

    I'm not sure what you need to do to reorder priorities. I would expect that the instructions https://github.com/cli/cli/blob/trunk/docs/install_linux.md#debian-ubuntu-linux-raspberry-pi-os-apt would work. Can you share the output when you try those commands?

    Very sorry for the late response. I uninstalled gh-cli, deleted old files in sources.list.d and tried installing from the page you gave, and now I do not get the error message on sudo apt update.

    Though I feel like I followed the instructions on that page when I installed gh-cli for the first time, I am unsure what could have changed this time.

    But the issue is resolved on my side. Thank you

  9. williammartin commented on Jul 7, 2025

    @williammartin
    Member

    Thanks for letting me know. I'm going to close this because the original author has not been responding and it's almost certainly not a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmore-info-neededMore info needed from user/contributorneeds-triageneeds to be reviewed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions