[Bug]: Debian/Ubuntu - installer using deprecated apt-key #1107

Open
opened 2026-04-24 23:32:41 +02:00 by adam · 2 comments
Owner

Originally created by @quartzbear on GitHub (Apr 26, 2023).

Describe the issue

Installer in ubuntu/debian uses deprecated apt-key instead of trusted.gpg.d

**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**
\
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
curl is already the newest version (7.81.0-1ubuntu1.10).
gnupg is already the newest version (2.2.27-3ubuntu2.1).
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK
**curl -s https://advplyr.github.io/audiobookshelf-ppa/KEY.gpg | sudo apt-key add -**
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK

Steps to reproduce the issue

  1. Install on Ubuntu
  2. Get warning message

Audiobookshelf version

2.2.19

How are you running audiobookshelf?

Debian/PPA

Originally created by @quartzbear on GitHub (Apr 26, 2023). ### Describe the issue Installer in ubuntu/debian uses deprecated apt-key instead of trusted.gpg.d ``` **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** \ Reading package lists... Done Building dependency tree... Done Reading state information... Done curl is already the newest version (7.81.0-1ubuntu1.10). gnupg is already the newest version (2.2.27-3ubuntu2.1). 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded. Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)). OK **curl -s https://advplyr.github.io/audiobookshelf-ppa/KEY.gpg | sudo apt-key add -** Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)). OK ``` ### Steps to reproduce the issue 1. Install on Ubuntu 2. Get warning message ### Audiobookshelf version 2.2.19 ### How are you running audiobookshelf? Debian/PPA
adam added the bug label 2026-04-24 23:32:41 +02:00
Author
Owner

@nfg42 commented on GitHub (Jun 14, 2023):

This is what I did to fix it.
sudo curl -s https://advplyr.github.io/audiobookshelf-ppa/KEY.gpg | sudo gpg --dearmour -o /usr/share/keyrings/audiobookshelf.gpg

Then edit /etc/apt/sources.list.d/audiobookshelf.list to use the new file.
deb [signed-by=/usr/share/keyrings/audiobookshelf.gpg] https://advplyr.github.io/audiobookshelf-ppa ./

@nfg42 commented on GitHub (Jun 14, 2023): This is what I did to fix it. sudo curl -s https://advplyr.github.io/audiobookshelf-ppa/KEY.gpg | sudo gpg --dearmour -o /usr/share/keyrings/audiobookshelf.gpg Then edit /etc/apt/sources.list.d/audiobookshelf.list to use the new file. deb [signed-by=/usr/share/keyrings/audiobookshelf.gpg] https://advplyr.github.io/audiobookshelf-ppa ./
Author
Owner

@iconoclasthero commented on GitHub (Sep 13, 2023):

According to the apt-key man page, this is what you should do. It worked on 22.04:

curl -s https://advplyr.github.io/audiobookshelf-ppa/KEY.gpg | sudo tee /etc/apt/trusted.gpg.d/audiobookshelf-ppa.asc

I looked at what it recommended at the bottom there and tried to put the ASCII key in /etc/apt/sources.list.d/audiobookshelf.list with Signed-By: in front of it and padded the blank line with a . but apt wouldn't start. I don't know if that's something worth pursuing, but—as I said—the above works fine. It's probably because the .list file isn't in the deb822 format.

It is only a matter of changing the documentation on the website I think.


$ man apt-key
APT-KEY(8)                                                         APT                                                        APT-KEY(8)

NAME
       apt-key - Deprecated APT key management utility

SYNOPSIS
       apt-key [--keyring filename] {add filename | del keyid | export keyid | exportall | list | finger | adv | update | net-update |
               {-v | --version} | {-h | --help}}
.
.
.
DEPRECATION
       Except for using apt-key del in maintainer scripts, the use of apt-key is deprecated. This section shows how to replace existing
       use of apt-key.

       If your existing use of apt-key add looks like this:

       wget -qO- https://myrepo.example/myrepo.asc | sudo apt-key add -

       Then you can directly replace this with (though note the recommendation below):

       wget -qO- https://myrepo.example/myrepo.asc | sudo tee /etc/apt/trusted.gpg.d/myrepo.asc

       Make sure to use the "asc" extension for ASCII armored keys and the "gpg" extension for the binary OpenPGP format (also known as
       "GPG key public ring"). The binary OpenPGP format works for all apt versions, while the ASCII armored format works for apt
       version >= 1.4.

       Recommended: Instead of placing keys into the /etc/apt/trusted.gpg.d directory, you can place them anywhere on your filesystem by
       using the Signed-By option in your sources.list and pointing to the filename of the key. See sources.list(5) for details. Since
       APT 2.4, /etc/apt/keyrings is provided as the recommended location for keys not managed by packages. When using a deb822-style
       sources.list, and with apt version >= 2.4, the Signed-By option can also be used to include the full ASCII armored keyring
       directly in the sources.list without an additional file.
@iconoclasthero commented on GitHub (Sep 13, 2023): According to the apt-key man page, this is what you should do. It worked on 22.04: `curl -s https://advplyr.github.io/audiobookshelf-ppa/KEY.gpg | sudo tee /etc/apt/trusted.gpg.d/audiobookshelf-ppa.asc` I looked at what it recommended at the bottom there and tried to put the ASCII key in /etc/apt/sources.list.d/audiobookshelf.list with `Signed-By:` in front of it and padded the blank line with a `.` but apt wouldn't start. I don't know if that's something worth pursuing, but—as I said—the above works fine. It's probably because the .list file isn't in the deb822 format. It is only a matter of changing the documentation on the website I think. ``` $ man apt-key APT-KEY(8) APT APT-KEY(8) NAME apt-key - Deprecated APT key management utility SYNOPSIS apt-key [--keyring filename] {add filename | del keyid | export keyid | exportall | list | finger | adv | update | net-update | {-v | --version} | {-h | --help}} . . . DEPRECATION Except for using apt-key del in maintainer scripts, the use of apt-key is deprecated. This section shows how to replace existing use of apt-key. If your existing use of apt-key add looks like this: wget -qO- https://myrepo.example/myrepo.asc | sudo apt-key add - Then you can directly replace this with (though note the recommendation below): wget -qO- https://myrepo.example/myrepo.asc | sudo tee /etc/apt/trusted.gpg.d/myrepo.asc Make sure to use the "asc" extension for ASCII armored keys and the "gpg" extension for the binary OpenPGP format (also known as "GPG key public ring"). The binary OpenPGP format works for all apt versions, while the ASCII armored format works for apt version >= 1.4. Recommended: Instead of placing keys into the /etc/apt/trusted.gpg.d directory, you can place them anywhere on your filesystem by using the Signed-By option in your sources.list and pointing to the filename of the key. See sources.list(5) for details. Since APT 2.4, /etc/apt/keyrings is provided as the recommended location for keys not managed by packages. When using a deb822-style sources.list, and with apt version >= 2.4, the Signed-By option can also be used to include the full ASCII armored keyring directly in the sources.list without an additional file. ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#1107