5

I am trying to just apt-get update on a ubuntu:22.04 docker container. On my local machine, when I spin up a new ubuntu:22.04 docker container and run apt-get update, no error occurs. However, on my Jenkins pipeline, I get this:

09:37:57  + apt-get update --allow-insecure-repositories
09:37:58  Get:1 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
09:37:58  Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
09:37:58  Ign:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
09:37:58  Get:3 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [23.2 kB]
09:37:59  Get:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
09:37:59  Ign:1 http://archive.ubuntu.com/ubuntu jammy InRelease
09:37:59  Get:5 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [909 kB]
09:37:59  Ign:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
09:37:59  Get:6 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [108 kB]
09:37:59  Ign:6 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
09:37:59  Get:7 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [17.5 MB]
09:38:00  Get:8 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [914 kB]
09:38:00  Get:9 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [908 kB]
09:38:01  Get:10 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [164 kB]
09:38:01  Get:11 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [266 kB]
09:38:01  Get:12 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1792 kB]
09:38:01  Get:13 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [1251 kB]
09:38:01  Get:14 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [28.6 kB]
09:38:01  Get:15 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [963 kB]
09:38:01  Get:16 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1149 kB]
09:38:01  Get:17 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [23.3 kB]
09:38:02  Get:18 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [49.0 kB]
09:38:02  Fetched 26.5 MB in 4s (6052 kB/s)
09:38:03  Reading package lists...
09:38:03  W: http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
09:38:03  W: http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
09:38:03  W: GPG error: http://security.ubuntu.com/ubuntu jammy-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
09:38:03  W: The repository 'http://security.ubuntu.com/ubuntu jammy-security InRelease' is not signed.
09:38:03  W: http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
09:38:03  W: http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
09:38:03  W: GPG error: http://archive.ubuntu.com/ubuntu jammy InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
09:38:03  W: The repository 'http://archive.ubuntu.com/ubuntu jammy InRelease' is not signed.
09:38:03  W: http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
09:38:03  W: http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
09:38:03  W: GPG error: http://archive.ubuntu.com/ubuntu jammy-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
09:38:03  W: The repository 'http://archive.ubuntu.com/ubuntu jammy-updates InRelease' is not signed.
09:38:03  W: http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
09:38:03  W: http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
09:38:03  W: GPG error: http://archive.ubuntu.com/ubuntu jammy-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
09:38:03  W: The repository 'http://archive.ubuntu.com/ubuntu jammy-backports InRelease' is not signed.
09:38:03  E: Problem executing scripts APT::Update::Post-Invoke 'rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true'

Why is this not working if they are using the same new container? I also even added --allow-insecure-repositories, so why is it verifying keys? Lastly, I see some methods online where I can add the keys with a curl command. Problem is... since this container is brand new, curl is not installed. It becomes a chicken and egg problem where I cannot curl the keys without having curl, and I cannot install curl without the keys.

Thanks!

4
  • (1) Are you using the latest version of Docker? (2) Are the permissions of the .gpg file 666? (3) Run file /etc/apt/trusted.gpg.d/company-keys.gpg, what is the answer?
    – harrymc
    Commented Apr 10, 2023 at 18:32
  • the gpg files in that folders are as follows: 14:01:35 ubuntu-keyring-2012-cdimage.gpg 14:01:35 ubuntu-keyring-2018-archive.gpg They are very outdated. How do I get the updated verions?
    – Jason Chan
    Commented Apr 10, 2023 at 21:31
  • See Install Docker Engine on Ubuntu and also Install Docker Desktop on Ubuntu.
    – harrymc
    Commented Apr 11, 2023 at 9:19
  • Could it be related to this, IE is your docker host machine running an older linux 4.x kernel? Commented May 15, 2023 at 20:43

0

You must log in to answer this question.

Browse other questions tagged .