Celeb Glow
news | March 04, 2026

Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-get(8))

I follow guide at

wget -qO -
sudo apt-key add - echo "deb stable main"
sudo tee -a /etc/apt/sources.list
sudo apt update && sudo apt install hazelcast=5.1.1

enter image description here

Error

Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-get(8)).

How to overcome this?

1

1 Answer

apt-key now seems to be deprecated, I have created a script that will detect and get the missing keys, you can get it here.

#!/bin/sh -e
tmp="$(mktemp)"
sudo apt-get update 2>&1 | sed -En 's/.*NO_PUBKEY ([[:xdigit:]]+).*/\1/p' | sort -u > "${tmp}"
cat "${tmp}" | xargs sudo gpg --keyserver "hkps://keyserver.ubuntu.com:443" --recv-keys # to /usr/share/keyrings/*
cat "${tmp}" | xargs -L 1 sh -c 'sudo gpg --yes --output "/etc/apt/trusted.gpg.d/$1.gpg" --export "$1"' sh # to /etc/apt/trusted.gpg.d/*
rm "${tmp}"

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy