I'm having trouble, while trying to run a docker container with a base ubuntu image.

While attempting to RUN apt-get update, I'm getting the following error:

W: GPG error: http://ppa.launchpad.net/webupd8team/java/ubuntu trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C2518248EEA14886
E: The repository 'http://ppa.launchpad.net/webupd8team/java/ubuntu trusty InRelease' is not signed.

But when I try to add the key like:

RUN apt-key adv --keyserver http://keyserver.ubuntu.com:80 --recv-keys C2518248EEA14886

I get the following error:

E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation

So attempting to install gnupg | gnupg1 | gnupg2 by RUN apt-get install -y gnupg1 I get the following error.

E: Package 'gnupg1' has no installation candidate

Here's my Dockerfile for reference just in case:

FROM ubuntu:latest

RUN apt-get install -y gnupg1

RUN apt-key adv --keyserver http://keyserver.ubuntu.com:80 --recv-keys C2518248EEA14886

RUN apt-get update && apt-get install -y \
    gradle \
    oracle-java8-installer \
    oracle-java8-set-default \
    unzip \
    wget \
&& rm -rf /var/lib/apt/lists/*

So if I understand this correctly I need to update apt-get to install gnupg (or a variation) which I need to update key chain but I can't do that unless I update apt-get.

So is there a trick/workaround to this cyclic dependency? Or am I doing something wrong?

I'm very new to ubuntu and docker maybe I'm missing something obvious.

  • Please add output of dpkg -l | grep gnupg to your question. – Pilot6 Dec 3 '19 at 12:13
  • gnupg and gnupg2 should be installed. – Pilot6 Dec 3 '19 at 12:15
  • @Pilot6 could you help me out a bit, I can't seem to get an output for that command when I added the command in Dockerfile. Where am I supposed to add the line? – Abbas Dec 3 '19 at 12:19
  • @Pilot6 I tried installing all three gnupg variations none worked. – Abbas Dec 3 '19 at 12:19
  • You run this command in a terminal. I have no idea what Dockerfile is. – Pilot6 Dec 3 '19 at 12:20

The ppa:webupd8team/java is discontinued. So there is no way to install anything from there.

Remove that PPA from your software sources.

If you don't have any other problems then I see no reason of any other steps.

  • Probably out of the scope for this question, I copied the lines from another image (an old one) for dockerfile. However could you tell me if ppa is discontinued how can I install java8 on the docker container? 'Cause I need it. – Abbas Dec 3 '19 at 12:27
  • You can search how to install Oracle java to Ubuntu. I am unaware of what is docker container. – Pilot6 Dec 3 '19 at 12:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.