I run the following command across all OpenVZ containers to update/upgrade:
vzctl exec2 $VM "apt-get update & apt-get upgrade"
In all cases, I get the following error:
dpkg-preconfigure: unable to re-open stdin: No such file or directory
And when there are updates available, the prompt "Do you want to continue" is skipped. Also, dpkg cannot set a lock:
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?
How can I fix this?