syntax issue in RPM repo config file causing failing update with `pkcon`
Summary
The RPM repo config file /etc/yum.repos.d/runner_gitlab-runner.repo contains a syntax issue that causes pkcon
on Fedora to abort package download of all available updates. This file must be updated: https://packages.gitlab.com/install/repositories/runner/gitlab-runner/config_file.repo?os=fedora&dist=30
Steps to reproduce
Install Fedora from https://getfedora.org. Then prepare environment in terminal as root:
-
dnf install -y PackageKit
# providespkcon
;pkcon --version
prints 1.1.12 on Fedora 30 and 1.1.13 on Fedora 32; both versions are affected wget --timestamping https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh
os=fedora dist=30 bash script.rpm.sh
dnf install -y gitlab-runner-13.0.0-1
pkcon refresh force && pkcon update --only-download -y && pkcon offline-get-prepared && pkcon offline-trigger
Actual behavior
default repo config file:
# cat /etc/yum.repos.d/runner_gitlab-runner.repo
...
gpgkey=https://packages.gitlab.com/runner/gitlab-runner/gpgkey
https://packages.gitlab.com/runner/gitlab-runner/gpgkey/runner-gitlab-runner-366915F31B487241.pub.gpg
...
output of update with pkcon
:
# pkcon refresh force && pkcon update --only-download -y && pkcon offline-get-prepared && pkcon offline-trigger
Refreshing cache [=========================]
Loading cache [=========================]
Downloading repository information[=========================]
Loading cache [=========================]
Finished [=========================]
Getting updates [=========================]
Finished [=========================]
No packages require updating to newer versions.
Expected behavior
The gitlab-runner package gets updated:
# pkcon refresh force && pkcon update --only-download -y && pkcon offline-get-prepared && pkcon offline-trigger
Refreshing cache [=========================]
Loading cache [=========================]
Downloading repository information[=========================]
Loading cache [=========================]
Downloading repository information[=========================]
Loading cache [=========================]
Downloading repository information[=========================]
Loading cache [=========================]
Finished [=========================]
Getting updates [=========================]
Finished [=========================]
Updating packages [=========================]
Starting [=========================]
Downloading packages [=========================]
Testing changes [=========================]
Finished [=========================]
Prepared updates:
gitlab-runner-13.0.1-1.x86_64
See "Possible fixes" for more information.
Relevant documentation
https://dnf.readthedocs.io/en/latest/conf_ref.html At "gpgkey" you can read:
gpgkey
list of strings
URLs of a GPG key files that can be used for signing metadata and packages of this repository, empty by default. ...
...
list
It is an option that could represent one or more strings separated by space or comma characters.
string
It is a sequence of symbols or digits without any whitespace character.
Possible fixes
You can get the expected behaviour if you modify vim /etc/yum.repos.d/runner_gitlab-runner.repo
to either of these:
- "each GPG key on its own line with attribute"
$ cat /etc/yum.repos.d/runner_gitlab-runner.repo ... gpgkey=https://packages.gitlab.com/runner/gitlab-runner/gpgkey gpgkey=https://packages.gitlab.com/runner/gitlab-runner/gpgkey/runner-gitlab-runner-366915F31B487241.pub.gpg ...
- "all GPG keys in a single line separated by empty space"
$ cat /etc/yum.repos.d/runner_gitlab-runner.repo ... gpgkey=https://packages.gitlab.com/runner/gitlab-runner/gpgkey https://packages.gitlab.com/runner/gitlab-runner/gpgkey/runner-gitlab-runner-366915F31B487241.pub.gpg ...
More information
Updating the packages as root with dnf clean all ; dnf update
or yum clean all ; yum update
works without a problem on Fedora and CentOS.
I could reproduce this problem only on Fedora so far.
On CentOS (https://centos.org) an older pkcon --version
is used:
- on CentOS 7: 1.1.10
- on CentOS 8: 1.1.12 , but I could not test because there are no packages in repo, this is handled in bug #25554
To prepare environment on CentOS 7:
yum install -y PackageKit
wget --timestamping https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh
-
bash script.rpm.sh
the output contains: ... Downloading repository file: https://packages.gitlab.com/install/repositories/runner/gitlab-runner/config_file.repo?os=centos&dist=7&source=script ... yum install -y gitlab-runner-13.0.0-1
To test the upgrade: Just like on Fedora run in terminal as root:
vim /etc/yum.repos.d/runner_gitlab-runner.repo
yum clean all ; yum update
pkcon refresh force && pkcon update --only-download -y && pkcon offline-get-prepared && pkcon offline-trigger