3

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

acgbox
  • 2,200

1 Answers1

2

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.

  • 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 – acgbox Nov 09 '21 at 23:17
  • did this worked ? – WaLid LamRaoui Nov 09 '21 at 23:20
  • 3
    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 – WaLid LamRaoui Nov 09 '21 at 23:22
  • Yes of course. my commands can all be discarded. Just yours is enough. Thank you so much. great contribution – acgbox Nov 09 '21 at 23:23
  • 1
    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 – WaLid LamRaoui Nov 09 '21 at 23:27