Paragon
Paragon

Reputation: 2722

Why is MongoDB unable to create a user on Ubuntu 11.10 when installing?

I am installing MongoDB on my Ubuntu 11.10 machine. After adding the appropriate line to /etc/apt/sources.list (using instructions from here), I type the following to install:

sudo apt-get install mongodb-10gen

It results in the following output:

Adding system user `mongodb' (UID 117) ...
Adding new user `mongodb' (UID 117) with group `nogroup' ...
useradd: cannot lock /etc/passwd; try again later.
adduser: `/usr/sbin/useradd -d /home/mongodb -g nogroup -s /bin/false -u 117 mongodb' returned error code 1. Exiting.
dpkg: error processing mongodb-10gen (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 mongodb-10gen
E: Sub-process /usr/bin/dpkg returned an error code (1)

I only have other terminal windows open (none of them running any programs) and Chromium open. Why might the install not be able to add a user?

Thanks,

ParagonRG

Upvotes: 2

Views: 1243

Answers (1)

Paragon
Paragon

Reputation: 2722

Solution, thanks to 'Thomas', from the this resource:

Look for /etc/group.lock, /etc/passwd.lock, and /etc/shadow.lock, and remove them. Make sure you're ONLY removing these files if they exist.

After doing this, I simply re-ran the install command and it successfully completed.

Upvotes: 1

Related Questions