我已经将我的 ubuntu 从 11.10 升级到 12.04。最后我发现当我尝试安装一些软件包时,它会显示错误。在阅读了一些博客后,我尝试通过“sudo dpkg --configure -a”修复该错误。但是当我运行此命令时,它显示另一个错误
Setting up colord (0.1.16-2) ...
useradd: cannot lock /etc/passwd; try again later.
adduser: `/usr/sbin/useradd -d /var/lib/colord -g colord -s /bin/false -u 115 colord' returned error code 1. Exiting.
dpkg: error processing colord (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up whoopsie (0.1.32) ...
useradd: cannot lock /etc/passwd; try again later.
adduser: `/usr/sbin/useradd -d /nonexistent -g whoopsie -s /bin/false -u 115 whoopsie' returned error code 1. Exiting.
dpkg: error processing whoopsie (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up lightdm (1.2.1-0ubuntu1) ...
Adding system user `lightdm' (UID 115) ...
Adding new user `lightdm' (UID 115) with group `lightdm' ...
useradd: cannot lock /etc/passwd; try again later.
adduser: `/usr/sbin/useradd -d /var/lib/lightdm -g lightdm -s /bin/false -u 115 lightdm' returned error code 1. Exiting.
dpkg: error processing lightdm (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of ubuntu-desktop:
ubuntu-desktop depends on lightdm; however:
Package lightdm is not configured yet.
dpkg: error processing ubuntu-desktop (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
colord
whoopsie
lightdm
ubuntu-desktop
我现在能做什么 ?
答案1
这为我修复了这个问题:
sudo delgroup scanner
sudo apt-get install colord
这对我来说很有效。以下是我采取的诊断步骤。
如果你查看- 并在顶部/var/lib/dpkg/info/colord.postinst
添加并手动运行它( ) - 它将无法通过添加扫描仪,如果你摆脱它,它会说:set -x
/var/lib/dpkg/info/colord.postinst configure
--quiet
sudo addgroup --system scanner
addgroup: The group `scanner' already exists and is not a system group. Exiting.
答案2
尝试这个:
[ -f /etc/gshadow.lock ] && sudo rm /etc/gshadow.lock
[ -f /etc/shadow.lock ] && sudo rm /etc/shadow.lock
[ -f /etc/passwd.lock ] && sudo rm /etc/passwd.lock
[ -f /etc/group.lock ] && sudo rm /etc/group.lock
sudo dpkg --configure -a