
#Sudo apt upgrade unable to acquire dpkg lock update#
In particular, as soon as a machine is booted for the first time, an update is performed. Stock Ubuntu server distributions perform packages update very aggressively. Assumptionsįor style purposes, I’ll use the inappropriate phrase “update apt”, intended as “update the apt indexes”. The crucial point is that, during the machine configuration stage, independently of how it’s performed, it’s desirable to update the machine (packages). stores the result into a new AMI (image).configures the machine, using Chef, and.instantiates an EC2 virtual machine, using a stock Ubuntu AMI (image),.

use Packer, which, when invoked, based on the configuration provided in a template….Teams working with cloud services typically have a process, either manual or automated, for building virtual machine images. The “screw it” solution: replace /usr/lib/apt/.

Readers interested in just solving the problem can skip to the Eureka™ section. In this post I’ll talk about a few approaches, and the stable solution I’ve implemented. In order to get an idea of the confusion about the subject, check out the number and scope of solutions in this Stack Overflow question. This seems to be a matter of discussion on the Stack Overflow network, but there are no working and stable solutions. When managing Ubuntu Server installations, for example image templates in the cloud, one of the main issues one comes across is apt locking, which causes the the annoying error Could not get lock /var/lib/apt/lists/lock, typically “at the worst times”.
