webmin: GPG error: the public key is not available: NO_PUBKEY 2D223B918916F2A2

Upgraded to the lastest Webmin version, now getting the following error when doing a sudo apt update

W: GPG error: https://download.webmin.com/download/newkey/repository stable Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 2D223B918916F2A2
E: The repository 'https://download.webmin.com/download/newkey/repository stable Release' 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.

Running on Ubuntu Linux 20.04.6

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 4
  • Comments: 63

Most upvoted comments

Any help will be highly appreciated.

Try:

cd /usr/share/webmin/
./setup-repos.sh -f

For those who are seeing this issue, try running :

cat /usr/share/webmin/webmin/developers-key.asc | gpg --dearmor >/usr/share/keyrings/debian-webmin-developers.gpg

If that fails, please post the output here…

For those who are seeing this issue, try running :

cat /usr/share/webmin/webmin/developers-key.asc | gpg --dearmor >/usr/share/keyrings/debian-webmin-developers.gpg

If that fails, please post the output here…

Fixed it for me

Any help will be highly appreciated.

Try:

cd /usr/share/webmin/
./setup-repos.sh -f

Thanks a lot !

The solution was in the error message:

W: Target Packages (contrib/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/webmin.list:1

In etc/apt/sources.list I comment out the line which mentions webmin:

# deb https://download.webmin.com/download/newkey/repository stable contrib

And /etc/apt/sources.list.d/webmin.list I left it and that solved my issue(s)!

Check your sources.list for duplicate entries

The right fix is generally the simplest thanks

The solution was in the error message:

W: Target Packages (contrib/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/webmin.list:1

In etc/apt/sources.list I comment out the line which mentions webmin:

# deb https://download.webmin.com/download/newkey/repository stable contrib

And /etc/apt/sources.list.d/webmin.list I left it and that solved my issue(s)!

Check your sources.list for duplicate entries

After running:

$ sudo su -
# cat /usr/share/webmin/webmin/developers-key.asc | gpg --dearmor >/usr/share/keyrings/debian-webmin-developers.gpg

It worked again …

@iliajie

Your commands was the fix for this problem. Thanks!

cd /usr/share/webmin/ ./setup-repos.sh -f

Same issue on an Ubuntu 22.04 64bit server

W: GPG error: https://download.webmin.com/download/newkey/repository stable Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 2D223B918916F2A2
E: The repository 'https://download.webmin.com/download/newkey/repository stable Release' 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.

then ran the commands but needed to change permissions on the gpg file and then changed back to 0644 and while the file is now not 0kb it still gives the same gpg error.

Hello,

I ran sudo cat /usr/share/webmin/webmin/developers-key.asc | gpg --dearmor >/usr/share/keyrings/debian-webmin-developers.gpg what gave me a Premission Denied.

Running as root I got no Permision Denied error but running sudo apt update still gives me

W: GPG error: https://download.webmin.com/download/newkey/repository stable Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 2D223B918916F2A2
E: The repository 'https://download.webmin.com/download/newkey/repository stable Release' 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.

Also when doing an apt update no updates are found, but within Webmin updates are found.

Odd that this failed when Webmin ran the same command. Unless perhaps you were out of disk space at the time?

Same problem here after clicking on the button in the webmin dashboard to switch to the new stable repository. My linux knowledge are limited, I tried to change the key with gpg but I am still searching the right command with the good fingerprint to solve the issue

See edited version above. On some servers, my installwebmin.sh bash script fixes any problems. On other servers it doesn’t.

#!/bin/bash apt update -y cd /tmp rm setup-repos.* #curl -o setup-repos.sh https://raw.githubusercontent.com/webmin/webmin/master/setup-repos.sh wget https://raw.githubusercontent.com/webmin/webmin/master/setup-repos.sh sh setup-repos.sh apt update -y apt install webmin --install-recommends -y /usr/share/webmin/changepass.pl /etc/webmin root ??? echo “Run:” echo “vim /etc/webmin/miniserv.conf” echo “Replace the line keyfile=/etc/webmin/miniserv.pem with:” echo “keyfile=/etc/certhelper/certs/???/privkey.pem” echo “certfile=/etc/certhelper/certs/???/fullchain.pem” echo “Then run systemctl restart webmin”

Please correct me if I’m wrong, so I can edit my first post with the proposed solutions.

I hate scrolling through forums and GitHub posts to find bits and pieces for a solution(s)

Solutions:

Solution 1:

cd /usr/share/webmin/ run ./setup-repos.sh -f

And thereafter editing /etc/apt/sources.list Add a # before the Webmin line

If you have the following:

/etc/apt/sources.list.d/webmin.list

Solution 2:

Run the following as

cat /usr/share/webmin/webmin/developers-key.asc | gpg --dearmor >/usr/share/keyrings/debian-webmin-developers.gpg

Solution 3

Any third solution?

So what solved it for me was: cd /usr/share/webmin/ ./setup-repos.sh -f

And thereafter editing /etc/apt/sources.list Add a # before the Webmin Line: # deb https://download.webmin.com/download/newkey/repository stable contrib

Thank you @iliajie and @SlowFox72 !!

No need for the cat commmand

Any help will be highly appreciated.

Try:

cd /usr/share/webmin/
./setup-repos.sh -f

These commands solved the Webmin’s Keys problem, thank you very much!

ATTENTION: The public key needs to be added with: apt-key add /usr/share/webmin/webmin/developers-key.asc Then run cat /usr/share/webmin/webmin/developers-key.asc | gpg --dearmor >/usr/share/keyrings/debian-webmin-developers.gpg

Do this as root.

It worked for me. It’s probably because some people (including me) used the old jcameron-key.asc key.

BEFORE W: GPG error: https://download.webmin.com/download/newkey/repository stable Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 2D223B918916F2A2 E: The repository ‘https://download.webmin.com/download/newkey/repository stable Release’ 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.

AFTER Ign:11 https://download.webmin.com/download/newkey/repository stable InRelease Get:12 https://download.webmin.com/download/newkey/repository stable Release [16.0 kB] Get:13 https://download.webmin.com/download/newkey/repository stable Release.gpg [819 B] Get:14 https://download.webmin.com/download/newkey/repository stable/contrib amd64 Packages [1442 B] Fetched 18.3 kB in 2s (8373 B/s)
Reading package lists… Done Building dependency tree… Done Reading state information… Done 3 packages can be upgraded. Run ‘apt list --upgradable’ to see them.

I have the same issue as above mentioned: After the /usr/share/webmin$ sudo ./setup-repos.sh -f

W: Target Packages (contrib/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/webmin.list:1
W: Target Packages (contrib/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/webmin.list:1
W: Target Translations (contrib/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/webmin.list:1
W: Target DEP-11 (contrib/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/webmin.list:1
W: Target DEP-11 (contrib/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/webmin.list:1
W: Target CNF (contrib/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/webmin.list:1
W: Target CNF (contrib/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/webmin.list:1
W: Target Packages (contrib/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/webmin.list:1
W: Target Packages (contrib/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/webmin.list:1
W: Target Translations (contrib/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/webmin.list:1
W: Target DEP-11 (contrib/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/webmin.list:1
W: Target DEP-11 (contrib/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/webmin.list:1
W: Target CNF (contrib/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/webmin.list:1
W: Target CNF (contrib/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list.d/webmin.list:1

Just tried it again: Pressing the upgrade button creates an empty gpg file. Running the mentioned command fails as well:

root@meet:~#  /usr/share/webmin/webmin/developers-key.asc | gpg --dearmor >/usr/share/keyrings/debian-webmin-developers.gpg
-bash: /usr/share/webmin/webmin/developers-key.asc: Keine Berechtigung
gpg: Keine gültigen OpenPGP-Daten gefunden.

You missed cat, the right command is:

cat /usr/share/webmin/webmin/developers-key.asc | gpg --dearmor >/usr/share/keyrings/debian-webmin-developers.gpg

Just tried it again: Pressing the upgrade button creates an empty gpg file. Running the mentioned command fails as well:

root@meet:~#  /usr/share/webmin/webmin/developers-key.asc | gpg --dearmor >/usr/share/keyrings/debian-webmin-developers.gpg
-bash: /usr/share/webmin/webmin/developers-key.asc: Keine Berechtigung
gpg: Keine gültigen OpenPGP-Daten gefunden.

All affected systems are running Debian 12. By the way I am observing strange file/directory copy problems on all systems that have been upgraded from Debian 11 to Debian 12 as well, maybe this is related.

For those who are seeing this issue, try running :

cat /usr/share/webmin/webmin/developers-key.asc | gpg --dearmor >/usr/share/keyrings/debian-webmin-developers.gpg

If that fails, please post the output here…

Thanks a lot Problem fixed by your command👍👍

just happened on a second system too. Fixed with the above command.

Both of my systems have >500GB free space on the partitions where the /usr/share and /etc dirs reside.

Of note, there was an existing debian-webmin-developers.gpg file there BEFORE I ran the above command. And I had to run it as root, sudo didn’t seem to work for some reason

Same here. Upon clicking the upgrade button, an empty keyring was generated in /usr/share/keyrings/debian-webmin-developers.gpg causing all upcoming apt update checks on the new webmin repo to fail.

Same issue here as well. I regret clicking the prompt now.