Skip to content

Provide deb/rpm repositories #448

Closed

Description

@iemejia

Describe the feature or problem you’d like to solve

Current distribution happens with a .deb file but it is not integrated with apt updates

Proposed solution

Add a repository to enable users to do easier updates of gh, it will enable to get the latest fixes and features.

Additional context

Activity

  1. vilmibm commented on Feb 14, 2020

    @vilmibm
    Contributor

    We definitely want this and just haven't had the time to set it up yet.

  2. mwichmann commented on Feb 17, 2020

    @mwichmann

    If it even needs saying, for RPM distros as well.

  3. nikolaik commented on May 12, 2020

    @nikolaik

    For those that are interested, I am using the following script as a workaround for now (requires curl and jq):

    #!/bin/bash
    set -eu
    LATEST_RELEASE=$(curl -s https://api.github.com/repos/cli/cli/releases/latest)
    VERSION=$(echo $LATEST_RELEASE | jq -r '.tag_name')
    DEB_URL=$(echo $LATEST_RELEASE | jq -r '.assets[].browser_download_url | select(. | contains("linux_amd64.deb"))')
    
    EXISTING_VERSION="v$(gh version | head -n1 | cut -d ' ' -f3)"
    if [[ "$EXISTING_VERSION" == "$VERSION" ]]; then echo "Already on latest version $VERSION."; exit 0; fi
    
    read -p "Press [Enter] to update gh to version $VERSION"
    
    wget --quiet -O gh_latest.deb $DEB_URL
    sudo dpkg -i gh_latest.deb
    rm gh_latest.deb
    gh --version
  4. Hydrog3n commented on May 12, 2020

    @Hydrog3n
  5. michaelBenin commented on May 16, 2020

    @michaelBenin

    No description when installing the deb file

    image

  6. bnb commented on Jul 8, 2020

    @bnb

    Hi yes hello I too would like to apt-get install gh if at all possible. Specifically, my use case is including the gh CLI in Codespaces environments ❤️

  7. michaelmhoffman commented on Aug 2, 2020

    @michaelmhoffman

    Thanks again for this amazing tool. The combination of the nag screen about the new version of gh available at the bottom of every use of it combined with inability to easily automatically upgrade on Ubuntu is a little annoying. Since you don't seem to want this to be install-and-forget, I would hope you would consider making a PPA a higher priority.

  8. michaelmhoffman commented on Aug 2, 2020

    @michaelmhoffman

    This is my bash auto-installer for now, based on @nikolaik's script above.

    TMPDIR="$(mktemp -dt "$(basename "$0").XXXXXXXXXX")"
    export TMPDIR
    
    on_exit ()
    {
        rm -rf "$TMPDIR"
    }
    
    trap on_exit EXIT
    
    exceeds-version-pkg() {
        local pkg="$1"
        local version="$2"
    
        local -a curr_version
        readarray -t curr_versions < <(apt-cache show "$pkg" | perl -ne 'print if s/Version: //;')
    
        for curr_version in "${curr_versions[@]}"; do
            if dpkg --compare-versions "$curr_version" ge "$version"; then
                return 0
            fi
        done
    
        return 1
    }
    
    install-deb () {
        local pkg="$1"
        local url="$2"
    
        local deb="$TMPDIR/${pkg}.deb"
    
        wget --quiet -O "$deb" "$url"
        sudo dpkg --install "$deb"
    }
    
    install-gh () {
        # based on https://github.com/cli/cli/issues/448#issuecomment-627322284
        local latest_release="$(curl -s https://api.github.com/repos/cli/cli/releases/latest)"
        local latest_version="$(jq -r '.tag_name' <<< $latest_release | sed -e 's/^v//')"
        local url="$(jq -r '.assets[].browser_download_url | select(. | contains("linux_amd64.deb"))' <<< "$latest_release")"
    
        if ! exceeds-version-pkg gh "$latest_version"; then
            install-deb gh "$url"
        fi
    }
    
    install-gh
  9. self-assigned this
    on Aug 5, 2020
  10. changed the title [-]Provide a debian/ubuntu repository for gh updates[/-] [+]Provide deb/rpm repositories[/+] on Aug 5, 2020
  11. vilmibm commented on Sep 3, 2020

    @vilmibm
    Contributor

    Watchers and lurkers: deb and rpm repositories are now live. If any adventurous souls would like to test them out and report back it'd be much appreciated.

    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
    sudo apt-add-repository -u https://cli.github.com/packages
    sudo apt install gh
    sudo dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
    sudo dnf install gh
  12. szuliq commented on Sep 4, 2020

    @szuliq

    So far working great @vilmibm. Will report on next release how the upgrade went. (I'm using .deb.)

  13. AliabbasMerchant commented on Sep 4, 2020

    @AliabbasMerchant
    Contributor

    Working properly, using dnf. Will report about the upgrade process once v0.12 is released.

  14. bnb commented on Sep 5, 2020

    @bnb

    Trying to run from Ubuntu in WSL. First command ran fine.

    /mnt/c/Users/accou ⌚ 11:58:06
    $ sudo apt-add-repository -u https://cli.github.com/packages
    Ign:1 https://cli.github.com/packages bionic InRelease
    Err:2 https://cli.github.com/packages bionic Release
      404  Not Found [IP: 185.199.108.153 443]
    Hit:3 http://archive.ubuntu.com/ubuntu bionic InRelease
    Hit:4 http://security.ubuntu.com/ubuntu bionic-security InRelease
    Hit:5 http://ppa.launchpad.net/ubuntu-desktop/ubuntu-make/ubuntu bionic InRelease
    Hit:6 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
    Hit:8 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
    Hit:7 https://apt.llvm.org/bionic llvm-toolchain-bionic-6.0 InRelease
    Reading package lists... Done
    E: The repository 'https://cli.github.com/packages bionic 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.
    
  15. mislav commented on Sep 8, 2020

    @mislav
    Contributor

    Hi everyone, we just pushed a v0.12 release to our deb & RPM repository: https://github.com/cli/cli/releases/tag/v0.12.0

    If you can try to upgrade, that would be great! Thank you 🙇

    @bnb I think we only publish packages for Ubuntu 20.04 for now! We can look into what would be involved in covering 18.04 as well.

  16. szuliq commented on Sep 8, 2020

    @szuliq

    I just upgraded and it worked great! Ubuntu 20.04

  17. vilmibm commented on Sep 8, 2020

    @vilmibm
    Contributor

    All extant Ubuntu LTS should now be supported.

    Thanks for the QA help, y'all!

  18. bnb commented on Sep 23, 2020

    @bnb

    Thanks @vilmibm and @mislav ❤️

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions