I am aware of the security implications and I understand why usage of apt-key was deprecated. For my use case, I do not care.
I want to run:
$ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CC116F55AA7F2382
without seeing any warnings. Yet I see:
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CC116F55AA7F2382
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
Executing: /tmp/apt-key-gpghome.KVaQ390iTM/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CC116F55AA7F2382 /dev/null
gpg: "/dev/null" not a key ID: skipping
gpg: key CC116F55AA7F2382: "Icinga GmbH (Build server) <info@icinga.com>" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
How to force no output for stdout and warnings? I only want to see output of an actual error is happening. (I am aware that the script is running on a system that already knows the key, as I have ran it before.)
I tried:
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CC116F55AA7F2382 > /dev/nullapt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CC116F55AA7F2382 2>&1 > /dev/nullapt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CC116F55AA7F2382 2>&1 /dev/null