How to circumvent “apt-key output should not be parsed”?

后端 未结 3 1369
野性不改
野性不改 2020-12-14 14:20

I\'m automating my Docker installation. Something like this:

if apt-key fingerprint 0EBFCD88 | grep \"Key fingerprint = 9DC8 5822 9FC7 DD38 854A E2D8 8D81 80         


        
3条回答
  •  半阙折子戏
    2020-12-14 14:51

    To reply to the part "am I getting this fundamentally wrong":

    I believe that possibly yes. That's the reason of the warning.

    You don't write what you do exactly, but one thing to realize is:

    The keys do have some expiration so after some time the fingerprint in your script will become obsolete and possibly it will not behave as expected anymore.

    Once the repository and its key is installed so the system somehow upgrades the key automatically but when the repository is initially added so an up-to-date key has to be provided. In my scripts automating the installation I do not test whether a key was already added but I test whether the repository was already added. If the repository was not added, so I add it together with an up-to-date key that I download always from its URL.

提交回复
热议问题