RPM import key error: key 1 not an armored public key

Written by - 0 comments

Published on - Listed in Linux Git

During a GitLab CI/CD pipeline run, one of the jobs failed with an error:

The error occurred while manually trying to import the GPG key for the EPEL repositories, in this case for the EL7 packages:

$ rpm --import ./rhel7/RPM-GPG-KEY-EPEL-7
error: ./rhel7/RPM-GPG-KEY-EPEL-7: key 1 not an armored public key.
Cleaning up project directory and file based variables 00:01
ERROR: Job failed: exit code 1

Although this error (not an armored public key) doesn't really hint what the actual problem could be, I noticed that there seemed to be a copy+paste error in the repository's RPM-GPG-KEY-EPEL7 file: A missing new line between the "Version" line and the beginning of the GPG key.

In the next commit, this was fixed in the repository and a newline added:

Added missing newline in GPG key

At the next pipeline run, the import of the GPG key worked successfully.

Interestingly using cat inside the pipeline job seems to remove newlines, which was the origin of the copy+paste error:

Missing newlines when using cat command inside Gitlab pipeline job

Add a comment

Show form to leave a comment

Comments (newest first)

No comments yet.