gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation

在 Docker 中 Ubuntu 添加密钥时遇到的错误

Step 4/14 : RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5
---> Running in dd67e1511194
E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation
The command '/bin/sh -c apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5' returned a non-zero code: 255

解决

在添加密钥之前执行
RUN apt-get update && apt-get install -y gnupg2

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容