Skip to content

[Bug] - gpg is not working #243

@herrsergio

Description

@herrsergio

Describe the bug
Using Amazon Linux 2022 latest Docker image, cannot get a key using gpg from a keyserver.

To Reproduce
Steps to reproduce the behavior:

  1. docker run -t -i --rm -u 0 public.ecr.aws/amazonlinux/amazonlinux:2022 bash
  2. gpg -v --keyserver hkps://keyserver.ubuntu.com --recv-keys 4ED778F539E3634C779C87C6D7062848A1AB005C
  3. The following error appears:
gpg: directory '/root/.gnupg' created
gpg: keybox '/root/.gnupg/pubring.kbx' created
gpg: keyserver receive failed: No dirmngr
  1. Tried to install dirmngr package:
Amazon Linux 2022 repository                                                                                                                          16 MB/s |  10 MB     00:00
Last metadata expiration check: 0:00:03 ago on Wed Nov 30 23:22:16 2022.
Error:
 Problem: problem with installed package gnupg2-minimal-2.3.7-1.amzn2022.0.2.x86_64
  - package gnupg2-minimal-2.3.7-1.amzn2022.0.2.x86_64 conflicts with gnupg2 provided by gnupg2-2.3.7-1.amzn2022.0.2.x86_64
  - conflicting requests
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)

  1. Installed it with: yum install dirmngr --allowerasing,
Details of packages installation
Dependencies resolved.
=====================================================================================================================================================================================
 Package                                       Architecture                      Version                                                Repository                              Size
=====================================================================================================================================================================================
Installing:
 gnupg2                                        x86_64                            2.3.7-1.amzn2022.0.2                                   amazonlinux                            2.5 M
Installing dependencies:
 cracklib                                      x86_64                            2.9.6-27.amzn2022.0.1                                  amazonlinux                             82 k
 cyrus-sasl-lib                                x86_64                            2.1.27-18.amzn2022.0.1                                 amazonlinux                            786 k
 dbus                                          x86_64                            1:1.12.20-3.amzn2022.0.1                               amazonlinux                            7.9 k
 dbus-broker                                   x86_64                            29-2.amzn2022.0.1                                      amazonlinux                            173 k
 dbus-common                                   noarch                            1:1.12.20-3.amzn2022.0.1                               amazonlinux                             15 k
 device-mapper                                 x86_64                            1.02.185-1.amzn2022.0.3                                amazonlinux                            140 k
 device-mapper-libs                            x86_64                            1.02.185-1.amzn2022.0.3                                amazonlinux                            181 k
 gnutls                                        x86_64                            3.7.7-356.amzn2022.0.1                                 amazonlinux                            1.1 M
 gzip                                          x86_64                            1.10-5.amzn2022.0.1                                    amazonlinux                            152 k
 kmod-libs                                     x86_64                            29-2.amzn2022.0.4                                      amazonlinux                             62 k
 libargon2                                     x86_64                            20171227-9.amzn2022.0.1                                amazonlinux                             29 k
 libdb                                         x86_64                            5.3.28-49.amzn2022.0.1                                 amazonlinux                            757 k
 libeconf                                      x86_64                            0.4.0-1.amzn2022.0.1                                   amazonlinux                             28 k
 libfdisk                                      x86_64                            2.37.4-1.amzn2022.0.2                                  amazonlinux                            155 k
 libksba                                       x86_64                            1.6.0-1.amzn2022.0.1                                   amazonlinux                            157 k
 libpwquality                                  x86_64                            1.4.4-6.amzn2022.0.1                                   amazonlinux                            106 k
 libseccomp                                    x86_64                            2.5.3-1.amzn2022.0.1                                   amazonlinux                             71 k
 libsecret                                     x86_64                            0.20.4-2.amzn2022.0.1                                  amazonlinux                            158 k
 libsemanage                                   x86_64                            3.4-5.amzn2022.0.1                                     amazonlinux                            121 k
 libusbx                                       x86_64                            1.0.24-2.amzn2022.0.1                                  amazonlinux                             73 k
 libutempter                                   x86_64                            1.2.1-4.amzn2022.0.1                                   amazonlinux                             26 k
 nettle                                        x86_64                            3.8-1.amzn2022.0.1                                     amazonlinux                            417 k
 openldap                                      x86_64                            2.4.57-6.amzn2022.0.2                                  amazonlinux                            257 k
 pam                                           x86_64                            1.5.1-8.amzn2022.0.2                                   amazonlinux                            544 k
 pcsc-lite                                     x86_64                            1.9.1-1.amzn2022.0.2                                   amazonlinux                             92 k
 pcsc-lite-libs                                x86_64                            1.9.1-1.amzn2022.0.2                                   amazonlinux                             28 k
 polkit                                        x86_64                            0.117-10.amzn2022.0.2                                  amazonlinux                            146 k
 polkit-libs                                   x86_64                            0.117-10.amzn2022.0.2                                  amazonlinux                            8.3 M
 polkit-pkla-compat                            x86_64                            0.1-19.amzn2022.0.1                                    amazonlinux                             45 k
 shadow-utils                                  x86_64                            2:4.8.1-9.amzn2022.0.1                                 amazonlinux                            1.1 M
 systemd                                       x86_64                            250.8-1.amzn2022.0.3                                   amazonlinux                            4.2 M
 systemd-libs                                  x86_64                            250.8-1.amzn2022.0.3                                   amazonlinux                            614 k
 systemd-pam                                   x86_64                            250.8-1.amzn2022.0.3                                   amazonlinux                            333 k
 util-linux                                    x86_64                            2.37.4-1.amzn2022.0.2                                  amazonlinux                            2.2 M
 util-linux-core                               x86_64                            2.37.4-1.amzn2022.0.2                                  amazonlinux                            434 k
 xkeyboard-config                              noarch                            2.33-1.amzn2022                                        amazonlinux                            784 k
Installing weak dependencies:
 cryptsetup-libs                               x86_64                            2.4.3-2.amzn2022.0.1                                   amazonlinux                            433 k
 diffutils                                     x86_64                            3.8-1.amzn2022.0.1                                     amazonlinux                            403 k
 gnupg2-smime                                  x86_64                            2.3.7-1.amzn2022.0.2                                   amazonlinux                            250 k
 kernel-libbpf                                 x86_64                            5.15.73-45.135.amzn2022                                amazonlinux                            155 k
 libxkbcommon                                  x86_64                            1.3.0-1.amzn2022.0.1                                   amazonlinux                            141 k
 pcsc-lite-ccid                                x86_64                            1.4.34-1.amzn2022.0.2                                  amazonlinux                            300 k
 pinentry                                      x86_64                            1.2.0-1.amzn2022.0.4                                   amazonlinux                             99 k
 qrencode-libs                                 x86_64                            4.1.1-2.amzn2022.0.1                                   amazonlinux                             66 k
 systemd-networkd                              x86_64                            250.8-1.amzn2022.0.3                                   amazonlinux                            612 k
 systemd-resolved                              x86_64                            250.8-1.amzn2022.0.3                                   amazonlinux                            277 k
Removing dependent packages:
 gnupg2-minimal                                x86_64                            2.3.7-1.amzn2022.0.2                                   @System                                917 k

Transaction Summary
=====================================================================================================================================================================================
Install  47 Packages
Remove    1 Package

Total download size: 29 M
Is this ok [y/N]: y
  1. Tried to get the key, but there is a connection timed out
bash-5.1# gpg -v --keyserver hkps://keyserver.ubuntu.com --recv-keys 4ED778F539E3634C779C87C6D7062848A1AB005C
gpg: no running dirmngr - starting '/usr/bin/dirmngr'
gpg: waiting for the dirmngr to come up ... (5s)
gpg: connection to the dirmngr established
gpg: keyserver receive failed: Connection timed out
bash-5.1#

Expected behavior

bash-4.2# gpg -v --keyserver hkps://keyserver.ubuntu.com --recv-keys 4ED778F539E3634C779C87C6D7062848A1AB005C
gpg: directory `/root/.gnupg' created
gpg: new configuration file `/root/.gnupg/gpg.conf' created
gpg: WARNING: options in `/root/.gnupg/gpg.conf' are not yet active during this run
gpg: keyring `/root/.gnupg/secring.gpg' created
gpg: keyring `/root/.gnupg/pubring.gpg' created
gpg: requesting key A1AB005C from hkps server keyserver.ubuntu.com
Comment: Hostname:
gpg: armor header:
Version: Hockeypuck 2.1.0-184-g50f1108
gpg: armor header:
gpg: pub  2048R/A1AB005C 2018-03-26  Beth Griggs <bgriggs@redhat.com>
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: using PGP trust model
gpg: key A1AB005C: public key "Beth Griggs <bgriggs@redhat.com>" imported
gpg: 1 keys cached (12 signatures)
gpg: 0 keys processed (0 validity counts cleared)
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions