By Victor
I am trying to install monitoring agent by running the command
curl -sSL https://agent.digitalocean.com/install.sh | sh
But I am getting the response
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?
I totally have no idea what this is,has anyone come across such issue or knows how to fix this?
Thank you.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
This error indicates that another process is using the package system (apt). Since this controls the installation and update of software on your platform it’s limited to a single process at a time to prevent it being corrupted.
You can use ps afx|grep dpkg to check if there is still a process running at the same time. sudo killall dpkg will stop all running dpkg processes.
sudo rm /var/lib/dpkg/lock can be used to manually remove the lock if there isn’t any other process using it. This can happen if another process crashed earlier without releasing the lock.
As @Cronus89 said, you will have to either run these and your other commands as the “root” user or use sudo in front of your command.
If you are doing this very early in the droplet creation process, eg. from a cloud-init script then the reason might be the fact that DigitalOcean’s local agent is also doing an apt-get update right after the droplet comes alive.
root 817 0.0 0.2 9576 2644 ? S 07:56 0:00 \_ /bin/bash /var/lib/cloud/instance/sem/do_agent
root 842 2.0 0.6 35572 6728 ? S 07:56 0:00 \_ apt-get -qq update
_apt 848 0.0 0.4 36224 5032 ? S 07:56 0:00 \_ /usr/lib/apt/methods/http
_apt 849 14.0 0.4 36224 5044 ? R 07:56 0:00 \_ /usr/lib/apt/methods/http
_apt 857 0.0 0.4 31856 4688 ? S 07:56 0:00 \_ /usr/lib/apt/methods/gpgv
_apt 924 0.0 0.8 40104 8824 ? R 07:56 0:00 \_ /usr/lib/apt/methods/store
The solution might be to wait a bit before doing the update or try again a few times until it succeeds.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.