Сбой стандартной команды: apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5

Я использую Docker, и я определил, что он не работает только в среде Docker.

$ docker run --rm -it --entrypoint bash resin/jetson-tx2-debian:stretch
root@8ddf33f82fee:/# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5
Executing: /tmp/apt-key-gpghome.aflZmH62Gv/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5
gpg: keyserver receive failed: Connection refused

Это похоже на проблему с тем, как dirmngr использует DNS-серверы. https://dev.gnupg.org/T3374 Внесение изменений в resolv.conf, кажется, помогает:

# Changed to only include "nameserver 8.8.8.8"
root@8ddf33f82fee:/# nano /etc/resolv.conf

И наконец успех

root@8ddf33f82fee:/# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5
Executing: /tmp/apt-key-gpghome.LQgK0o5ZBJ/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5
gpg: key 40976EAF437D05B5: public key "Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1

Проверка версий:

root@afff63f7c3b7:/# dirmngr --version
dirmngr (GnuPG) 2.1.18
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
root@afff63f7c3b7:/# gpg --version
gpg: WARNING: unsafe permissions on homedir '/root/.gnupg'
gpg (GnuPG) 2.1.18
libgcrypt 1.7.6-beta
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: /root/.gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
        CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2

У меня вопрос, какое уместное решение здесь? Мои пакеты, кажется, обновлены, но эти ошибки сохраняются.

0