Since 20.04, apt can wait for a lock. The apt(8) command automatically waits for a lock for 120 seconds (non- interactive) or infinitely.
The apt-get(8) command can be configured to wait as well by passing the -o DPkg::Lock::Timeout=<number of seconds>, where <number of seconds> may also be -1 for infinite. This avoids any races you'd get by doing the lock yourself and then invoking apt. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1693361 Title: cloud-init sometimes fails on dpkg lock due to concurrent apt- daily.service execution To manage notifications about this bug go to: https://bugs.launchpad.net/apt/+bug/1693361/+subscriptions -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
