ntp failed to install/upgrade: useradd: cannot lock /etc/passwd; try again later.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
shadow (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: ntp
When installing I get the folliwing error:
sudo aptitude install ntp
[sudo] password for joshua:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
The following partially installed packages will be configured:
ntp
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 0B will be used.
Writing extended state information... Done
Setting up ntp (1:4.2.
useradd: cannot lock /etc/passwd; try again later.
adduser: `/usr/sbin/useradd -d /home/ntp -g ntp -s /bin/false -u 119 ntp' returned error code 1. Exiting.
chown: invalid user: `ntp:ntp'
dpkg: error processing ntp (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
ntp
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Setting up ntp (1:4.2.
useradd: cannot lock /etc/passwd; try again later.
adduser: `/usr/sbin/useradd -d /home/ntp -g ntp -s /bin/false -u 119 ntp' returned error code 1. Exiting.
chown: invalid user: `ntp:ntp'
dpkg: error processing ntp (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
ntp
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Description: Ubuntu 9.10
Release: 9.10
ntp:
Installed: 1:4.2.4p6+
Candidate: 1:4.2.4p6+
Version table:
*** 1:4.2.4p6+
500 http://
100 /var/lib/
affects: | ntp (Ubuntu) → adduser (Ubuntu) |
Thanks for your report.
This is very similar to bug 432964. Check that there's a file called /etc/gshadow.lock, and possibly /etc/shadow.lock, /etc/passwd.lock too; if that's the case, remove them (no risk), and retry. The problem might come from a crash while using the guest session: do you remember such a situation?