Contents

RPM Import GPG Key

In the process of local repo setup/sync, I ran into a loop where RPM packages were downloaded but then removed due to a missing GPG key.

The reason reposync complains is that the upstream requires gpgcheck. For example:

[docker-ce]
name=Docker-CE Repository
baseurl=https://download.docker.com/linux/centos/7/$basearch/stable
enabled=1
gpgcheck=1
keepcache=0
gpgkey=https://download.docker.com/linux/centos/gpg

[docker-engine]
name=Docker-Engine Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/7
enabled=1
gpgcheck=1
keepcache=0
gpgkey=https://yum.dockerproject.org/gpg

Resolution

  1. Disable gpgcheck in the upstream repo setting.
  2. Import the GPG keys.

To Import GPG Keys

Note: gpg --import is not the same as rpm --import.

https_proxy=http://proxy-url:8000 sudo -E rpm --import https://yum.dockerproject.org/gpg