Skip to content

Commit 60a6db9

Browse files
committed
Cirrus CI: configure apt-get to wait for locks
I saw Cirrus CI / Vagrant BOX:rockylinux/[email protected] 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 <[email protected]> (cherry picked from commit 6a913ac) Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent fd0566c commit 60a6db9

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

.cirrus.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ task:
2626
# v7.0.0 does not boot. v6.0.0 was not released.
2727
BOX: rockylinux/[email protected]
2828
install_libvirt_vagrant_script: |
29-
apt-get update
30-
apt-get install -y libvirt-daemon libvirt-daemon-system vagrant vagrant-libvirt
29+
# if another process is keeping a lock, wait for 60 seconds for it to release the lock.
30+
apt-get -o DPkg::Lock::Timeout=60 update
31+
apt-get -o DPkg::Lock::Timeout=60 install -y libvirt-daemon libvirt-daemon-system vagrant vagrant-libvirt
3132
systemctl enable --now libvirtd
3233
3334
vagrant_cache:
@@ -61,8 +62,9 @@ task:
6162
memory: 16G
6263

6364
install_libvirt_vagrant_script: |
64-
apt-get update
65-
apt-get install -y libvirt-daemon libvirt-daemon-system vagrant vagrant-libvirt
65+
# if another process is keeping a lock, wait for 60 seconds for it to release the lock.
66+
apt-get -o DPkg::Lock::Timeout=60 update
67+
apt-get -o DPkg::Lock::Timeout=60 install -y libvirt-daemon libvirt-daemon-system vagrant vagrant-libvirt
6668
systemctl enable --now libvirtd
6769
6870
vagrant_cache:

0 commit comments

Comments
 (0)