Score:2

how to replace apt-key for webmin

tr flag

how to replace apt-key for webmin in ubuntu 20.04 (because apparently apt-key is deprecated)?

before (bash script):

wget -q https://www.webmin.com/jcameron-key.asc -O- | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] http://download.webmin.com/download/repository sarge contrib"
sudo apt install webmin

now error:

gpg: no valid OpenPGP data found

I tried with this, but it doesn't work (bash script):

wget -qO - https://www.webmin.com/jcameron-key.asc | sudo gpg --dearmor | sudo gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/webmin.gpg --import -
sudo add-apt-repository "deb [arch=amd64] http://download.webmin.com/download/repository sarge contrib"
sudo apt install webmin

Note: with or without sudo gpg --dearmor or http/https

new error:

GPG error: http://download.webmin.com/download/repository sarge Release: The following signatures could not be verified because their public key is not available: NO_PUBKEY D97A3AE911F63C51

how do i fix it (bash script)? thanks

WaLid LamRaoui avatar
uz flag
hi, can you please tell us which Ubuntu version you're using ?
acgbox avatar
tr flag
in the question above is the SO and the version. ubuntu 20.04 x64
WaLid LamRaoui avatar
uz flag
yeah my bad i didn't notice that sorry
acgbox avatar
tr flag
don't worry. it has happened to me too
N0rbert avatar
zw flag
Have you tried to install http://prdownloads.sourceforge.net/webadmin/webmin_1.981_all.deb ?
WaLid LamRaoui avatar
uz flag
when running `sudo apt update` do you get error : The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D97A3AE911F63C51 ?
acgbox avatar
tr flag
@WaLidLamRaoui yes. this is it. (the error described appears in the question)
acgbox avatar
tr flag
@N0rbert I can't be downloading the .deb every time webmin is updated. That's what the repository is supposed to be for
Score:2
uz flag

For some reason the key wasn't imported correctly, you can always check by listing all currently imported keys by executing :

apt-key list 

And searching for 1719 003A CE3E 5A41 E2DE 70DF D97A 3AE9 11F6 3C51

If it's missing try importing the key from ubuntu keyserver by running :

    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys D97A3AE911F63C51 

the output sould be something like :

Executing: /tmp/apt-key-gpghome.neTpxcHlMl/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys D97A3AE911F63C51
gpg: key D97A3AE911F63C51: public key ..... imported
gpg: Total number processed: 1
gpg:               imported: 1

Again Check if it's imported correctly apt-key list.

Finally :

sudo apt update 
sudo apt install webmin

this should work.

acgbox avatar
tr flag
why don't you complete the solution including the corrected commands that I posted, because as it is it does not work in a bash script
WaLid LamRaoui avatar
uz flag
did this worked ?
WaLid LamRaoui avatar
uz flag
in your case i think this: `sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys D97A3AE911F63C51` with `sudo apt update` and `sudo apt install webmin` should get webmin to be installed
acgbox avatar
tr flag
Yes of course. my commands can all be discarded. Just yours is enough. Thank you so much. great contribution
WaLid LamRaoui avatar
uz flag
You're welcome, later i will make an edit to this answer to make it better and even include a bash script to install webmin, but for now it's 1:00 am and i really need to get some rest
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.