Error installing software with apt and software center: /etc/passwd locked by /usr/share/system-config-printer/applet.py
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
system-config-printer (Ubuntu) |
Expired
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: apt
I'm using Ubuntu 10.10. I tried installing Code::Blocks from the Ubuntu Software Center and got a message "Package operation failed" even though Code::Blocks seems to have installed perfectly. I've had the same problem while installing other applications and have ignored it without any repercussions that I can tell. Below is the output when attempting the same installation from the terminal. The error is identical to the one I got from the software center.
~$ sudo apt-get install libcodeblocks0
Reading package lists... Done
Building dependency tree
Reading state information... Done
libcodeblocks0 is already the newest version.
The following packages were automatically installed and are no longer required:
python-utidylib python-gtkmozembed libtidy-0.99-0 python-feedparser
python-rsvg python-evolution libgdiplus libboost-
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.
1 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Do you want to continue [Y/n]? y
Setting up hal (0.5.14-0ubuntu6) ...
useradd: cannot lock /etc/passwd; try again later.
adduser: `/usr/sbin/useradd -d /var/run/hald -g haldaemon -s /bin/false -u 116 haldaemon' returned error code 1. Exiting.
dpkg: error processing hal (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
hal
E: Sub-process /usr/bin/dpkg returned an error code (1)
So I tried to see what has locked /etc/passwd and found the culprit is applet.py:
greeenguru@
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
applet.py 1982 greeenguru 10r REG 8,1 1698 2886356 /etc/passwd
And I found which applet.py has locked /etc/passwd:
greeenguru@
1000 1982 1598 0 Dec20 ? 00:00:02 /usr/bin/python /usr/share/
It seems that /usr/share/
but the solution is to run this:
sudo rm -f /etc/gshadow.lock /etc/shadow.lock /etc/passwd.lock
and I don't fully understand what the repercussions of that might be.
ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: apt 0.8.3ubuntu7
ProcVersionSign
Uname: Linux 2.6.35-23-generic i686
NonfreeKernelMo
Architecture: i386
Date: Thu Dec 23 01:24:59 2010
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release i386 (20101007)
ProcEnviron:
LANG=en_US.utf8
SHELL=/bin/bash
SourcePackage: apt
I guess the applet is provided by system- config- printer, so lets reassign it to them, as there is nothing apt can do about.
P.S.: The packages are not completely installed - some are dangling half-installed on your system as you can see in the end of the APT output. More information about the states can be seen with: dpkg --audit