I'm creating an Ansible Playbook to set up Ubuntu 18.04.1 VPSs and am encountering a problem where I can't reliably install Python.
Since Ubuntu 18.04.1 is not shipping with Python installed, I'm forced to use the following command
apt -y update && apt -y install python with the
I've also managed to get this error in a shell into which I manually ssh'd into.
root@ansible:~# apt -y update && apt -y install python Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease Hit:2 http://archive.ubuntu.com/ubuntu bionic-security InRelease Hit:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease Reading package lists... Done Building dependency tree Reading state information... Done 17 packages can be upgraded. Run 'apt list --upgradable' to see them. E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
This is a Virtual Machine in VirtualBox on a Windows host.
I've also tried with using
apt update and
apt install, even doing something like this
while fuser /var/lib/dpkg/lock >/dev/null 2>&1; do sync && sleep 1; done between
install, but it usually fails.
It is a system which has been set up with the following steps: https://askubuntu.com/questions/946787/ubuntu-server-installation-with-root-only/1066033#1066033