Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not get lock /var/lib/dpkg/lock #114

Open
mauriziod opened this issue Apr 25, 2019 · 2 comments
Open

Could not get lock /var/lib/dpkg/lock #114

mauriziod opened this issue Apr 25, 2019 · 2 comments

Comments

@mauriziod
Copy link

mauriziod commented Apr 25, 2019

Seems like following step or the one before is leaving the dpkg lock file behind.

amazon-ebs: TASK [ansiblebit.oracle-java : debian | ensure the apt repository key is present] ***
    amazon-ebs: changed: [127.0.0.1]
    amazon-ebs:
    amazon-ebs: TASK [ansiblebit.oracle-java : debian | ensure the apt repository is present] ***
    amazon-ebs: changed: [127.0.0.1]
    amazon-ebs:
    amazon-ebs: TASK [ansiblebit.oracle-java : debian | set license as accepted] ***************
    amazon-ebs: changed: [127.0.0.1]
    amazon-ebs:
    amazon-ebs: TASK [ansiblebit.oracle-java : debian | ensure Java is installed] **************
    amazon-ebs: fatal: [127.0.0.1]: FAILED! => {"cache_update_time": 1556186475, "cache_updated": false, "changed": false, "msg": "'/usr/bin/apt-get -y -o \"Dpkg::Options::=--force-confdef\" -o \"Dpkg::Options::=--force-confold\"     install 'oracle-java11-installer'' 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, "stderr": "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", "stderr_lines": ["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?"], "stdout": "", "stdout_lines": []}�[0m
    amazon-ebs: 	to retry, use: --limit @/tmp/packer-provisioner-ansible-local/5cc18532-7700-4008-eea8-f90ee8a93274/microservice-scala.retry
    amazon-ebs:
    amazon-ebs: PLAY RECAP *********************************************************************
    amazon-ebs: 127.0.0.1                  : ok=29   changed=20   unreachable=0    failed=1   �[0m
    amazon-ebs:
@mauriziod
Copy link
Author

mauriziod commented Apr 29, 2019

Obviously not the most elegant solution but ensuring the dpkg/lock fileis removed before the debian | ensure Java is installed worked.

amazon-ebs: TASK [oracle-java : debian | set license as accepted] **************************
    amazon-ebs: changed: [127.0.0.1]
    amazon-ebs:
    amazon-ebs: TASK [oracle-java : debian | remove apt-get lock] ******************************
    amazon-ebs: changed: [127.0.0.1]
    amazon-ebs:
    amazon-ebs: TASK [oracle-java : debian | ensure Java is installed] *************************
    amazon-ebs: changed: [127.0.0.1]
    amazon-ebs:

Definitely the step causing the troubles is:

debian | set license as accepted

@steenzout
Copy link
Member

@mauriziod this seems to indicate that you had another process running apt-get update or apt-get install.

during my tests I haven't found this problem yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants