geerlingguy / docker-ubuntu2004-ansible

Ubuntu 20.04 LTS (Focal Fossa) Docker container for Ansible playbook and role testing.
https://hub.docker.com/r/geerlingguy/docker-ubuntu2004-ansible
MIT License
83 stars 49 forks source link

Unable to update apt cache #24

Open MLNW opened 2 years ago

MLNW commented 2 years ago

For some reason, I am unable to update the apt cache with this docker image. I tried it with ubuntu:latest where everything works fine. Do you have an idea how to solve this?

❯ mol login                                                                                          13:22:28  
INFO     Running default > login
root@tinytex-ubuntu:/# apt update
Get:1 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB]
Err:1 http://archive.ubuntu.com/ubuntu focal InRelease
  Couldn't create temporary file /tmp/apt.conf.7vCFS7 for passing config to apt-key
Get:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Err:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease
  Couldn't create temporary file /tmp/apt.conf.n79pfd for passing config to apt-key
Get:3 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Err:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease
  Couldn't create temporary file /tmp/apt.conf.95a2eh for passing config to apt-key
Err:3 http://security.ubuntu.com/ubuntu focal-security InRelease
  Couldn't create temporary file /tmp/apt.conf.ardLfm for passing config to apt-key
Reading package lists... Done
W: GPG error: http://archive.ubuntu.com/ubuntu focal InRelease: Couldn't create temporary file /tmp/apt.conf.7vCFS7 for passing config to apt-key
E: The repository 'http://archive.ubuntu.com/ubuntu focal InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://archive.ubuntu.com/ubuntu focal-updates InRelease: Couldn't create temporary file /tmp/apt.conf.n79pfd for passing config to apt-key
E: The repository 'http://archive.ubuntu.com/ubuntu focal-updates InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://archive.ubuntu.com/ubuntu focal-backports InRelease: Couldn't create temporary file /tmp/apt.conf.95a2eh for passing config to apt-key
E: The repository 'http://archive.ubuntu.com/ubuntu focal-backports InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://security.ubuntu.com/ubuntu focal-security InRelease: Couldn't create temporary file /tmp/apt.conf.ardLfm for passing config to apt-key
E: The repository 'http://security.ubuntu.com/ubuntu focal-security InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

My molecule.yml:

dependency:
  name: galaxy
driver:
  name: podman
platforms:
  #- name: tinytex-centos
  #  image: docker.io/geerlingguy/docker-centos8-ansible
  #  pre_build_image: true
  - name: tinytex-ubuntu
    image: docker.io/geerlingguy/docker-ubuntu2004-ansible
    pre_build_image: true
provisioner:
  name: ansible
verifier:
  name: ansible
MLNW commented 2 years ago

I guess it might be related to #10 since I am using podman. But it still works with other images and your CentOS8 image works without issue.

loraine-gueguen commented 3 months ago

Hi. I have had a similar error with image geerlingguy/docker-ubuntu2004-ansible:latest that I have fixed by adding a task for chmod 1777 /tmp

ok: [instance] => {
      "msg": {
          "changed": true,
          "cmd": "apt-get update && apt-get -y install apt-transport-https ca-certificates gnupg gpg-agent",
          "delta": "0:00:04.096494",
          "end": "2024-08-02 07:53:06.915538",
          "failed": false,
          "msg": "",
          "rc": 0,
          "start": "2024-08-02 07:53:02.819044",
          "stderr": "W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://security.ubuntu.com/ubuntu focal-security InRelease: Couldn't create temporary file /tmp/apt.conf.6DJWwh for passing config to apt-key\nW: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://archive.ubuntu.com/ubuntu focal InRelease: Couldn't create temporary file /tmp/apt.conf.Hc79Dm for passing config to apt-key\nW: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://archive.ubuntu.com/ubuntu focal-updates InRelease: Couldn't create temporary file /tmp/apt.conf.FQd78s for passing config to apt-key\nW: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://archive.ubuntu.c/
          "stderr_lines": [
              "W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://security.ubuntu.com/ubuntu focal-security InRelease: Couldn't create temporary file /tmp/apt.conf.6DJWwh for passing config to apt-key",
              "W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://archive.ubuntu.com/ubuntu focal InRelease: Couldn't create temporary file /tmp/apt.conf.Hc79Dm for passing config to apt-key",
              "W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://archive.ubuntu.com/ubuntu focal-updates InRelease: Couldn't create temporary file /tmp/apt.conf.FQd78s for passing config to apt-key",
              "W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://archive.ubuntu.com/ubuntu focal-backports InRelease: Couldn't create temporary file /tmp/apt.conf.W5JTZt for passing config to apt-key",
              "W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/InRelease  Couldn't create temporary file /tmp/apt.conf.Hc79Dm for passing config to apt-key",
              "W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease  Couldn't create temporary file /tmp/apt.conf.FQd78s for passing config to apt-key",
              "W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease  Couldn't create temporary file /tmp/apt.conf.W5JTZt for passing config to apt-key",
              "W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease  Couldn't create temporary file /tmp/apt.conf.6DJWwh for passing config to apt-key",
              "W: Some index files failed to download. They have been ignored, or old ones used instead.",
              "debconf: unable to initialize frontend: Dialog",
              "debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)",
              "debconf: falling back to frontend: Readline",
              "debconf: unable to initialize frontend: Readline",
              "debconf: (This frontend requires a controlling tty.)",
              "debconf: falling back to frontend: Teletype",
              "dpkg-preconfigure: unable to re-open stdin: "
          ],
[...]

full log: https://github.com/abims-sbr/ansible-sequenceserver/actions/runs/10212004094/job/28254439075#step:5:297