Could not get lock /var/lib/apt/lists/lock

nodejs

#1

This is the code I’m running on the circleci machine:

sudo rm -rf /opt/circleci/.nvm            
curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -
sudo apt-get install -y -f nodejs

I’m getting this error:

## Installing the NodeSource Node.js 10.x repo...


## Populating apt-get cache...

+ apt-get update
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/
Error executing command, exiting

Reading package lists... Done


Building dependency tree       


Reading state information... Done

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 nodejs : Depends: libv8-3.14.5 but it is not installable
E: Unable to correct problems, you have held broken packages.
/home/circleci/project/edcode/.circleci/setup_node.sh: 6: /home/circleci/project/edcode/.circleci/setup_node.sh: npm: not found
Exited with code 127

#2

Search for it on the forum, this has been asked before. :smiley:


#3

@halfer

Can you share the other post? I’m having trouble locating it.


#4

Yes; I didn’t have time before. I will look now.

Edit: this is the one I had in mind. Second answer for “could not get lock”.


#5

Ah, it’s a different file, so a search didn’t find it.

@hassaans please let us know if the above thread doesn’t help you.