Skip to content

gitlab-runner install fails with "E: Unable to locate package gitlab-runner"

i followed the instructions on https://docs.gitlab.com/runner/install/linux-repository.html to install a gitlab runner on a freshly-installed mint 19.3 machine. the procedure fails with the error message "E: Unable to locate package gitlab-runner"

$ curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | sudo bash

[sudo] password for matmacorp:
Detected operating system as LinuxMint/sylvia.
Checking for curl...
Detected curl...
Checking for gpg...
Detected gpg...
Running apt-get update... done.
Installing apt-transport-https... done.
Installing /etc/apt/sources.list.d/runner_gitlab-runner.list...done.
Importing packagecloud gpg key... done.
Running apt-get update... done.

The repository is setup! You can now install packages.

$ sudo apt-get install gitlab-runner

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package gitlab-runner

adding packages.gitlab.com to my apt preferences did not change the error.

$ cat <<EOF | sudo tee /etc/apt/preferences.d/pin-gitlab-runner.pref

> Explanation: Prefer GitLab provided packages over the Debian native ones
> Package: gitlab-runner
> Pin: origin packages.gitlab.com
> Pin-Priority: 1001
> EOF
Explanation: Prefer GitLab provided packages over the Debian native ones
Package: gitlab-runner
Pin: origin packages.gitlab.com
Pin-Priority: 1001

$ sudo apt-get install gitlab-runner

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package gitlab-runner

after considerable sniffing around, i concluded that packages.gitlab.com doesn't have an entry for "sylvia" (mint 18.3) yet, but the install script assumes that whatever is listed in "/etc/lsb_release" will exist on the packages.gitlab.com web site.

$ cat /etc/lsb-release
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=18.3
DISTRIB_CODENAME=sylvia
DISTRIB_DESCRIPTION="Linux Mint 18.3 Sylvia"

to confirm, i surfed directly to this address:

https://packages.gitlab.com/runner/gitlab-runner/packages/linuxmint/sylvia/gitlab-runner_11.7.0_amd64.deb

...and got the error: "The page you were looking for doesn't exist". the url for "sonya" (an earlier mint version) works just fine, so i used that one instead. here is the url for sonya:

https://packages.gitlab.com/runner/gitlab-runner/packages/linuxmint/sonya/gitlab-runner_11.7.0_amd64.deb

in summary:

  • the surface-level bug is that packages.gitlab.com doesn't have sylvia yet.

  • imo the deeper bug is that the gitlab-runner install script ("install.deb.sh") does not detect the problem, leading to an obscure error ("Unable to locate package gitlab-runner") for a condition that is likely to occur in the future. the script should detect the problem in advance and give the user a more clear message. alternately (or additionally), the instructions on the installation web page ("https://docs.gitlab.com/runner/install/linux-repository.html") should discuss what to do if the error occurs.