debian安装zerotier遇到更新key报错解决

一键安装zerotier,出现更新源报错

1
2
3
4
curl -s https://install.zerotier.com  sudo bash

Err:8 http://download.zerotier.com/debian/bullseye bullseye InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 1657198823E52A61

导入key报错

1
2
3
4
root@openmediavault:~# curl -s 'https://raw.githubusercontent.com/zerotier/ZeroTierOne/master/doc/contact%40zerotier.com.gpg'  gpg --import && \
> if z=$(curl -s 'https://install.zerotier.com/' gpg); then echo "$z" sudo bash; fi
-bash: gpg: command not found
root@openmediavault:~# apt install gpg

又出现报错

1
2
3
4
5
6
root@openmediavault:~# curl -s 'https://raw.githubusercontent.com/zerotier/ZeroTierOne/master/doc/contact%40zerotier.com.gpg'  gpg --import && \
> if z=$(curl -s 'https://install.zerotier.com/' gpg); then echo "$z" sudo bash; fi
gpg: directory '/root/.gnupg' created
gpg: keybox '/root/.gnupg/pubring.kbx' created
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0

导入key又又出现报错

1
2
3
4
5
6
7
root@openmediavault:~# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1657198823E52A61
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
Executing: /tmp/apt-key-gpghome.hr9IcDzLaX/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 1657198823E52A61
gpg: error running '/usr/bin/dirmngr': probably not installed
gpg: failed to start the dirmngr '/usr/bin/dirmngr': Configuration error
gpg: connecting dirmngr at '/tmp/apt-key-gpghome.hr9IcDzLaX/S.dirmngr' failed: Configuration error
gpg: keyserver receive failed: No dirmngr

解决:apt-get install dirmngr

但是又又又出现报错

1
2
3
4
5
6
7
8
9
root@openmediavault:~# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1657198823E52A61
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
Executing: /tmp/apt-key-gpghome.XR2ODJfUDA/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 1657198823E52A61
gpg: key 1657198823E52A61: public key "ZeroTier, Inc. (ZeroTier Support and Release Signing Key) <contact@zerotier.com>" imported
gpg: error running '/usr/bin/gpg-agent': probably not installed
gpg: failed to start agent '/usr/bin/gpg-agent': Configuration error
gpg: can't connect to the agent: Configuration error
gpg: Total number processed: 1
gpg: imported: 1

解决:apt install gpg-agent

大吉大利,添加key成功,成功装上zerotier了