On Debian-based Linux systems, the apt-key command is used to manage the keys used by apt to authenticate packages that are downloaded and installed. All packages that have been verified using local keys will be considered trusted and can be installed on the system. In 2004, the British company Canonical released Ubuntu. It was built on Debian, a popular distribution at the time that required a lot of installation work. Ubuntu was consequently suggested as a friendly replacement.
Every six months, Canonical, responsible for managing Ubuntu, releases a new version. Due to its simplicity of use, the Ubuntu Desktop Linux distribution by Canonicals is one of the most used. It’s also a popular option for those just starting out with Linux. Most internet servers also run server editing, which we won’t focus on here. We have mentioned the steps below to fix apt-key deprecated warning in Ubuntu
Ways to fix apt-key deprecated warning in Ubuntu
Method 1: Next command will download a remote GPG key, encrypt it and save it in the /usr/share/keyrings directory.
“wget -nc
“jcameron-key.asc cat | gpg –darling | sudo tee /usr/share/keyrings/jcameron-key.gpg > /dev/null 2>&1”
Method 2: We can also use the install command which is used by operating system to install files to the file system.
“wget -nc ‘cat jcameron-key.asc| gpg –dearmor > jcameron-key.gpg”“sudo install -o root -g root -m 644 jcameron-key.gpg /usr/share/keyrings/”
Method 3: Instead of using several commandsyou can merge them and use a single line command like:
“roll up | gpg –darling | sudo tee /usr/share/keyrings/jcameron-key.gpg > /dev/null 2>&1”
Final Words
We hope you enjoy our article on How to fix apt-key deprecated warning in Ubuntu. The apt-key command has been deprecated and will likely not work in the future, although the warning mentioned above does not prevent you from upgrading. For any other repositories set up on your system without a signed option, apt-key can force the system to accept signatures from third-party key holders, which is one of the reasons it has been deprecated.