我试图在ubuntu上安装docker,然后按照安装指南,我看到了这个命令。
"curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -"在它的响应中,我得到了OK,没有真正的下载。我是否应该提供一个键或者这个curl命令的目的是什么。
发布于 2017-11-21 07:47:41
apt-key add为坞库添加了一个受信任的密钥。curl命令正在下载该密钥并将其传输到apt-key add命令,该命令将其添加为受信任的密钥。
>man apt-key
COMMANDS
Add filename
Add a new key to the list of trusted keys. The key is read from the filename
given with the parameter filename or if the filename is - from standard
input.
It is critical that keys added manually via apt-key are verified to belong
to the owner of the repositories they claim to be for otherwise the apt-
secure(8) infrastructure is completely undermined.简而言之,此命令下载密钥时将其添加为受信任的密钥。
发布于 2021-02-01 16:23:03
我这样做是以另一种方式来理解的!
1.文件的存储密钥
#curl -fsSL https://download.docker.com/linux/debian/gpg > key_stored2file2.在可信密钥列表中添加一个新密钥.
#apt-key add key_stored2file
OK如果给出了- 而不是文件名(在上面的示例中,),那么它将从标准输入中获取,因此它可以作为一个命令运行,如下所示*
#curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - https://stackoverflow.com/questions/47407718
复制相似问题