gpg: keyserver receive failed: No dirmngr
Installing the package dirmngr
fixed the error.
user@debian-server:~$ sudo apt-get install dirmngr
Retrying :
user@debian-server:~$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
Executing: /tmp/apt-key-gpghome.haKuPppywi/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
gpg: key A6A19B38D3D831EF: public key "Xamarin Public Jenkins (auto-signing) <[email protected]>" imported
gpg: Total number processed: 1
gpg: imported: 1
I wasn't able to get dirmngr to work, but you can also just import the key directly using apt-key add. The GPG public key is often listed at the root of the repo like http://origin-download.mono-project.com/repo/
curl https://origin-download.mono-project.com/repo/xamarin.gpg | sudo apt-key add -