環境
- Ubuntu16.04
- Ansible2.5.4
発生した事象
vagrant provision
時に以下のエラーが発生。- playbook内で、
apt-get dist-upgrade
を実行している
発生したエラー
TASK [Update all packages to the latest version] ******************************* fatal: [default]: FAILED! => {"changed": false, "msg": "'/usr/bin/apt-get dist-upgrade' failed: E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)\nE: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?\n", "rc": 100, "stdout": "", "stdout_lines": []}
結論
以下で解決。
$ sudo rm /var/lib/apt/lists/lock $ sudo rm /var/cache/apt/archives/lock