APT Configuration GPG Error in new installation

Hello, I’m quite new to XWiki and as well new to the Linux world. So, please excuse if might ask something I should know.

Something about my configuration:

  • Virtual Machine on Hyper-V
  • Debian 10 installation
  • http/https proxy for APT and wget

I am trying to follow the Debian installation guide on the XWiki documentation page but I fail at the first step.
When I try to run the command

wget -q "https://maven.xwiki.org/public.gpg" -O- | sudo apt-key add - sudo wget "https://maven.xwiki.org/stable/xwiki-stable.list" -P /etc/apt/sources.list.d/

The following message is displayed:

   gpg: no valid OpenPGP data found.
   gpg: can't open 'sudo': No such file or directory
   gpg: can't open 'wget': No such file or directory
   gpg: can't open 'https://maven.xwiki.org/stable/xwiki-stable.list': No such file or directory
   gpg: can't open '-P': No such file or directory
   gpg: /etc/apt/sources.list.d/: read error: Is a directory
   gpg: no valid OpenPGP data found.

Can someone tell me what I am doing wrong? Thank you in advance.

The error suggests you did not really executed the command you pasted but provided it is as parameter of another command.

Thank you for your answer but I really executed this comand like provided as user root. So I do not exactly know how I should execute this command otherwise.

Well you get a GPG error complaining about your command as it you passed it as a parameter of gpg.

Do you have a suggestions how to execute this command to get this work?

No other than just execute this command which does not seems to be the case here as otherwise this error would not make any sense.

What happen if you execute just

wget -q "https://maven.xwiki.org/public.gpg" -O-

If I run this command nothing happens, if I list the directory where I actually am I do not see the file

root@de1-xyz-v1:/home/installation_sources# wget -q “https://maven.xwiki.org/public.gpg” -O-
root@de1-xyz-v1:/home/installation_sources# ls -la
total 8
drwxr-xr-x 2 root root 4096 Jun 26 02:43 .
drwxr-xr-x 5 root root 4096 Jun 26 02:43 …

Ha wait I read too quickly. You just don’t execute the right command.

There is two commands in https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationViaAPT/#HAPTConfiguration and you just concatenated them in one command which cannot work.

Ahh this does make sense. Now I get this errors

root@xyz-v1:/home/installation_sources# wget -q “https:// maven. xwiki. org/public.gpg” -O- | sudo apt-key add -
gpg: no valid OpenPGP data found.

root@xyz-v1:/home/installation_sources# sudo wget “https:// maven.xwiki. org/stable/xwiki-stable.list” -P /etc/apt/sources.list.d/
–2020-06-26 04:59:04-- https:// maven. xwiki. org/stable/xwiki-stable.list
Resolving cachecl. proxy. com (cachecl. proxy. com)…
Connecting to cachecl.proxy. com (cachecl.proxy. com)||:8080… connected.
ERROR: The certificate of ‘maven. xwiki. org’ is not trusted.
ERROR: The certificate of ‘maven.xwiki. org’ doesn’t have a known issuer.

Don’t be confused I had to make some spaces into the links because otherwise I can’t post because I’m a new user.

Looks like the content of the https:// maven. xwiki. org/public.gpg file is not properly downloaded for some reason.

Could you try

wget https://maven.xwiki.org/public.gpg

to get some more details.

It usually means that your system does not support let’s encrypt certificates or that you are behind a proxy which blocks access to https://maven.xwiki.org/public.gpg.

Okay, that does make sense. Another stupid question is it possible to manually download it? I’m behind a proxy

Sure but there is no point. What you are doing here is configuring apt to get packages from https://maven.xwiki.org/, apt is not going to access this server if wget cannot.

So either you configure your proxy to allow https://maven.xwiki.org/ or you download each XWiki Debian package by hand and install it using dpkg. Honestly if you are not going to use apt it might be simpler to follow https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationWAR/ instead.

You will then have another problem, once installed XWiki itself also need to download stuff. You can take a look at https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationViaAPT/#HInstallingwithoutinternetconnection.

okay so as I see this now the best way is to allow it in the proxy. I think the AV maybe blocks the download of the public.gpg file.

The thing what I’m wondering about is the message that the certificate from maven.xwiki.org is not trusted.

The certificate used for https://maven.xwiki.org is Let’s Encrypt and it might not be supported in old systems.

Ideally you should make sure your system trust it, an alternative is simply to use http instead of https.

to use http instead of https is a very good idea if it works so far :slight_smile:

I think I’m coming a little closer now. I got that it works with curl but not with wget. Is there anything else I could try?

Not sure what you mean exactly. It does not work with http or you are back testing with https ?

Yes I am back with https. I don’t feel that well by using plain http to be honest

I don’t feel that well by using plain http to be honest

It’s not too critical for this command since all it does is downloading https://maven.xwiki.org/stable/xwiki-stable.list which itself contain the URL that apt will use.

it works with curl but not with wget

This is pretty weird since both should use the same certificates AFAIK.

Anyway what’s important is that apt works, as I said there is no much risk with wget (you can always check the content of the file after the download to be safe).