ntp failed to install/upgrade: useradd: cannot lock /etc/passwd; try again later.

Bug #488641 reported by Joshua Lückers
12
This bug affects 2 people
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.4p6+dfsg-1ubuntu5) ...
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.4p6+dfsg-1ubuntu5) ...
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+dfsg-1ubuntu5
  Candidate: 1:4.2.4p6+dfsg-1ubuntu5
  Version table:
 *** 1:4.2.4p6+dfsg-1ubuntu5 0
        500 http://ubuntu.mirror.cambrium.nl karmic/main Packages
        100 /var/lib/dpkg/status

Chuck Short (zulcss)
affects: ntp (Ubuntu) → adduser (Ubuntu)
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

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?

affects: adduser (Ubuntu) → shadow (Ubuntu)
Changed in shadow (Ubuntu):
status: New → Incomplete
summary: - NTP client fails to install
+ ntp failed to install/upgrade: useradd: cannot lock /etc/passwd; try
+ again later.
Revision history for this message
Joshua Lückers (joshualuckers) wrote :

The file /etc/gshadow.lock is not present. /etc/shadow.lock and /etc/passwd.lock are present.
Removing both *.lock file's did the trick.

I do not remember a crash while using a guest session, but my system did indeed crashed once before.

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Thanks for following up. I'm marking as duplicate of bug 432964. Don't hesitate to submit any new bug.

Changed in shadow (Ubuntu):
status: Incomplete → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.