Add Baculum deb repository using GPG

Hello,

Another question on how to replace apt-key with gpg.

Here is the original command:

wget -qO - http://www.bacula.org/downloads/baculum/baculum.pub | apt-key add -

And here is my attempted replacement, which unfortunately doesn’t work:

curl http://www.bacula.org/downloads/baculum/baculum.pub | gpg --dearmor | sudo tee /usr/share/keyrings/baculum.gpg > /dev/null 2>&1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
gpg: no valid OpenPGP data found.

If I try:

wget -qO - http://www.bacula.org/downloads/baculum/baculum.pub

A PGP public key is displayed, so I think the issue is with my gpg attempt.

Thanks
VW

Hello,

I’ve tried to troubleshoot my attempted command.

I can now see why it’s not working, but I don’t understand why / how to resolve.

If I try this:

curl http://www.bacula.org/downloads/baculum/baculum.pub

Then the PGP key should be displayed on the screen, but nothing is being displayed?

This is why the command is not working.

But the wget command does display the PGP key, so the path to the PGP key is correct.

I ended up trying the following:

wget -qO - http://www.bacula.org/downloads/baculum/baculum.pub | gpg --dearmor | sudo tee /usr/share/keyrings/baculum.gpg

Which has created baculum.gpg, so this command may have worked.

Would be interesting to understand why curl doesn’t work.

Thanks
VW

Unfortunately, the public key is not available, so either the above command hasn’t worked properly, or I have made an error somewhere else.

sudo apt-get update
Err:5 https://www.bacula.org/downloads/baculum/stable-11/debian bullseye InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY E72D44EC5C3DBD51
Hit:10 https://www.bacula.org/packages/651c57a54dffa/debs/13.0.3 bullseye Release
Reading package lists... Done
W: GPG error: https://www.bacula.org/downloads/baculum/stable-11/debian bullseye InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY E72D44EC5C3DBD51
E: The repository 'http://www.bacula.org/downloads/baculum/stable-11/debian bullseye InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

The issue was my initial attempt at configuring the list file.

Here is the correct configuration:

deb [signed-by=/usr/share/keyrings/baculum.gpg] http://www.bacula.org/downloads/baculum/stable-11/debian bullseye main
deb-src [signed-by=/usr/share/keyrings/baculum.gpg] http://www.bacula.org/downloads/baculum/stable-11/debian bullseye main
1 Like