OK, there is an easy way around that. Create a file called /etc/apt/sources.list.d/gitlab-runner.list with the following content:
# this file was generated by packages.gitlab.com for
# the repository at https://packages.gitlab.com/runner/gitlab-runner
deb [signed-by=/usr/share/keyrings/runner_gitlab-runner-archive-keyring.gpg] https://packages.gitlab.com/runner/gitlab-runner/ubuntu/ jammy main
deb-src [signed-by=/usr/share/keyrings/runner_gitlab-runner-archive-keyring.gpg] https://packages.gitlab.com/runner/gitlab-runner/ubuntu/ jammy main
now, install the Gitlab runner like this:
apt-get install gitlab-runner=17.4.2-1
that should pull in any dependencies that the package needs. If you already have Gitlab runner packages installed then you will need to remove them first including the helper package. I don’t believe a helper package exists for that version, so I think your problem is you are trying to install an older runner, when a newer one is already installed.
And this does work, because I just did it:
apt-get install gitlab-runner=17.4.2-1
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
docker-engine
The following NEW packages will be installed:
gitlab-runner
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 501 MB of archives.
After this operation, 569 MB of additional disk space will be used.
Get:1 https://packages.gitlab.com/runner/gitlab-runner/ubuntu jammy/main amd64 gitlab-runner amd64 17.4.2-1 [501 MB]
Fetched 500 MB in 20s (24.5 MB/s)
Selecting previously unselected package gitlab-runner.
(Reading database ... 195145 files and directories currently installed.)
Preparing to unpack .../gitlab-runner_17.4.2-1_amd64.deb ...
Unpacking gitlab-runner (17.4.2-1) ...
And here it is when installed:
dpkg -l | grep -i gitlab
ii gitlab-runner 17.4.2-1 amd64 GitLab Runner
as you can see, it’s installing just the gitlab-runner package, no helper package. So remove the newer gitlab-runner and helper packages that you already have installed.
One thing I will add is that if the above copy/paste doesn’t work for the apt list file due to missing GPG key, then run this script from the Gitlab runner install instructions:
curl -L "https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh" | sudo bash
since that will create the apt list file that I copied/pasted above.