6

To validate that the docker gpg key is installed, I ran:

sudo apt-key fingerprint 0EBFCD88 | grep "9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88"

Which resulted in the following output:

Warning: apt-key output should not be parsed (stdout is not a terminal)
      9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88

I found this Stack Overflow question on how to circumvent the warning, but I couldn't find any sources on why it appears in the first place? What's the reason you shouldn't parse apt-key output?

5

From man apt-key:

DESCRIPTION
   apt-key is used to manage the list of keys used by apt to authenticate
   packages. Packages which have been authenticated using these keys will
   be considered trusted.
   Note that if usage of apt-key is desired the additional installation of
   the GNU Privacy Guard suite (packaged in gnupg) is required. For this
   reason alone the programmatic usage (especially in package maintainer
   scripts!) is strongly discouraged. Further more the output format of all
   commands is undefined and can and does change whenever the underlying
   commands change.  apt-key will try to detect such usage and generates
   warnings on stderr in these cases.
1
  • What does this mean? Why the fact that "if usage of apt-key is desired the additional installation of the GNU Privacy Guard suite (packaged in gnupg) is required" is the reason that "programmatic usage ... is strongly discouraged"? I cannot make this leap. – Andrew Savinykh Jun 1 at 5:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.