From 6a913ac82e4b396677310038ad5cb93252d42cc2 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 4 Jul 2023 11:28:58 +0200 Subject: [PATCH] Cirrus CI: configure apt-get to wait for locks I saw Cirrus CI / Vagrant BOX:rockylinux/8@5.0.0 failing during setting up Vagrant, which may be due to other scripts provisioning the machine; Reading package lists... apt-get install -y libvirt-daemon libvirt-daemon-system vagrant vagrant-libvirt E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 2496 (apt-get) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it? Configure dpkg to wait for locks to be released instead of failing. I used 60 second as timeout, which is relatively long, but given that the Vagrant checks are known to take some time to run, is probably fine. Signed-off-by: Sebastiaan van Stijn --- .cirrus.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 1252edffa..db7d2dd91 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -26,8 +26,9 @@ task: # v7.0.0 does not boot. v6.0.0 was not released. BOX: rockylinux/8@5.0.0 install_libvirt_vagrant_script: | - apt-get update - apt-get install -y libvirt-daemon libvirt-daemon-system vagrant vagrant-libvirt + # if another process is keeping a lock, wait for 60 seconds for it to release the lock. + apt-get -o DPkg::Lock::Timeout=60 update + apt-get -o DPkg::Lock::Timeout=60 install -y libvirt-daemon libvirt-daemon-system vagrant vagrant-libvirt systemctl enable --now libvirtd vagrant_cache: @@ -61,8 +62,9 @@ task: memory: 16G install_libvirt_vagrant_script: | - apt-get update - apt-get install -y libvirt-daemon libvirt-daemon-system vagrant vagrant-libvirt + # if another process is keeping a lock, wait for 60 seconds for it to release the lock. + apt-get -o DPkg::Lock::Timeout=60 update + apt-get -o DPkg::Lock::Timeout=60 install -y libvirt-daemon libvirt-daemon-system vagrant vagrant-libvirt systemctl enable --now libvirtd vagrant_cache: