Linux & Co.

“apt-key deprecated” – the solution

The installation instructions don't work? Don't worry, only one command needs to be swapped.

If software cannot be installed under Debian, Ubuntu and their derivatives via the official package sources, developers often ask Personal Package Archives (PPA) available. In order to use these, a key must be added to the system so that it trusts the PPAs. So far it has worked apt key add – but this is deprecated in current systems, i.e. outdated and no longer available.

gpg instead of apt-key

Let's take a concrete example: the software audio bookshelf provides a traditional installation guide:

PPA hinzufügen:
sudo apt install gnupg curl
curl -s https://advplyr.github.io/audiobookshelf-ppa/KEY.gpg | sudo apt-key add -
sudo curl -s -o /etc/apt/sources.list.d/audiobookshelf.list https://advplyr.github.io/audiobookshelf-ppa/audiobookshelf.list

Audiobookshelf installieren:
sudo apt update
sudo apt install audiobookshelf

However, the following line no longer works and only returns the deprecated message:

curl -s https://advplyr.github.io/audiobookshelf-ppa/KEY.gpg |\
sudo apt-key add -

The entire error message then reads:

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

By the way: apt key(8) means:

man apt-key 8

Section 8 does not mean time bulls here, but the part with administrative commands in the handbook/manual.

The new way, described in Debian Wiki:

curl -s https://advplyr.github.io/audiobookshelf-ppa/KEY.gpg |\
sudo gpg -o /usr/share/keyrings/foobar-archive-keyring.gpg --dearmor

So instead of apt-key doing the job now gpg. About -o is output to the specified file (output file) and dearmor removes the encoding feature ASCII armor. But you don't have to worry about that.

While the installation instructions may vary slightly, the bottom line is that your apt-key add by gpg --dearmor -o replaced.

More about Linux.

Mirco Lang

Freelance journalist, Sauerland exile, (fairly old) skateboarder, graduate computer scientist, retail salesman, open source nerd, Checkmk handbook writer. Ex-Saturn'ler, Ex-Data-Becker'ler, Ex-BSI'ler. First contact with computers: ca. 1982 - a friend's big brother's C64. If you want to read more about open source, Linux and craft stuff and support Tutonaut here: About Coffee sponsorship via Paypal.I'm always happy. In advance: Thank you! Do not miss: cli.help and VoltAmpereWatt.de. New: Mastodon

3 comments

  1. “But this doesn’t mean time bulls,” → Time Bull? wtf?

    But well, what do you expect from an Apple user site.

Leave a Comment

Your e-mail address will not be published. Required fields are marked with * marked

This website uses Akismet to reduce spam. Learn more about how your comment data is processed.

Back to Top button
Close

Oops!

Please deactivate your ad blocker.