The public key is not available: NO_PUBKEY 075721F6A224060A

I have a freshly installed raspberri PI 3+.
I installed the 64 bit OS on it and I want to install openhab now.

#uname -a
Linux RPI64 6.6.20+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.20-1+rpt1 (2024-03-07) aarch64 GNU/Linux

I followed the instructions at linux - package - repository installation: in other words added the pubkey to /usr/share/keyrings

Also the apt sources refers to this key.

# cat openhab.list
deb [signed-by=/usr/share/keyrings/openhab.pgp] https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable main

When executing apt update I get the following error message

the public key is not available: NO_PUBKEY 075721F6A224060A

Added key with apt-key as well:

# apt-key list
/etc/apt/trusted.gpg
--------------------
pub   rsa4096 2015-07-25 [SC] [expires: 2030-09-09]
      EDB7 D030 4E2F CAF6 29DF  1163 0757 21F6 A224 060A
uid           [ unknown] openHAB Bintray Repositories <owner@openhab.org>
sub   rsa4096 2015-07-25 [E] [expires: 2030-09-09]

Result of apt update gives following error:

# apt update
Hit:1 http://deb.debian.org/debian bookworm InRelease
Hit:2 http://deb.debian.org/debian-security bookworm-security InRelease
Hit:3 http://deb.debian.org/debian bookworm-updates InRelease
Hit:4 http://archive.raspberrypi.com/debian bookworm InRelease
Get:5 https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable InRelease [12.8 kB]
Err:5 https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 075721F6A224060A
Reading package lists... Done
W: GPG error: https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 075721F6A224060A
E: The repository 'https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable 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.

Any help much appreciated

What do you mean by that, Raspi OS ? OpenHABian ? Dated when ? Exactly name the image and link

Again, give the exact link of the instructions you followed so we’re sure we’re talking about the same.

Assuming you installed the openHABian image - why did you proceed with manual ?
If not, why don’t you use openHABian ?

I did not install OpenHABian.
I installed the latest Raspberry PI OS:

Raspberry Pi OS with desktop
Release date: March 15th 2024
System: 64-bit
Kernel version: 6.6
Debian version: 12 (bookworm)
Size: 1,105MB
Show SHA256 file integrity hash:
Release notes

I was following these instructions from openhab.com

https://www.openhab.org/docs/installation/linux.html#package-repository-installation

It’s generic instructions for Linux and normally noone would ever apply this on Raspi OS as there’s the openHABian image available and recommended to use on Raspberries.

The message that I had was

The following signatures were invalid: EXPKEYSIG 075721F6A224060A openHAB Bintray Repositories <owner@openhab.org>

I followed the instructions on the download page and now everything is ok.

The step you mentioned ( Added key with apt-key as well: ) does not help you as that seems to install the key in /etc/apt/trusted.gpg while your openhab.list used the key that is stored in /usr/share/keyrings/openhab.pgp.

I think something went wrong or you did not follow the exact steps to install the key under
/usr/share/keyrings/openhab.pgp - as it works here.

In the meantime I found the solution. I read in one of the blog that the “signed by” clause in /apt/sources.list.d should have the .pgp extension in stead of .gpg.
Clearly this was wrong: I changed it back to .gpg and now all fine

# cat openhab.list
deb [signed-by=/usr/share/keyrings/openhab.gpg] https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable main
 # apt update
Hit:1 http://deb.debian.org/debian bookworm InRelease
Hit:2 http://deb.debian.org/debian-security bookworm-security InRelease
Get:3 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]
Get:4 http://archive.raspberrypi.com/debian bookworm InRelease [23.6 kB]
Get:5 https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable InRelease [12.8 kB]
Get:6 http://archive.raspberrypi.com/debian bookworm/main arm64 Packages [374 kB]
Get:7 http://archive.raspberrypi.com/debian bookworm/main armhf Packages [383 kB]
Get:8 https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable/main arm64 Packages [5,447 B]
Get:9 https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable/main armhf Packages [5,447 B]
Fetched 847 kB in 3s (314 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
4 packages can be upgraded. Run 'apt list --upgradable' to see them.

Many thanks for the help anyhow.

Topic can be closed

It obviously doesn’t make sense to refer to a pgp file when it’s gpg.
That’s also not in the install instructions you quoted.
So you should at least have told us that you changed it.

All of this fiddling (not to mention asking others for support and their time to provide it) is avoided by using openHABian. It’s made to relieve from exactly all of this unnecessary work, so everybody please deploy it to that purpose rather than use manual install if you’re on a platform that it supports.