Tente isto:
[ -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
Eu atualizei meu Ubuntu de 11,10 para 12,04. Finalmente eu posso achar que quando eu tento instalar alguns pacotes, ele mostra um erro. depois de ler algum blog eu tentei corrigir esse erro "sudo dpkg --configure -a". mas quando eu executo este comando ele mostra outro erro isso
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
o que posso fazer agora?
Tente isto:
[ -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
Isso corrige isso para mim:
sudo delgroup scanner
sudo apt-get install colord
Isso fez isso por mim. Abaixo, os passos diagnósticos que fiz.
se você olhar para /var/lib/dpkg/info/colord.postinst
- e adicionar set -x
no topo e executá-lo manualmente ( /var/lib/dpkg/info/colord.postinst configure
) - não será possível adicionar o scanner, e se você se livrar de --quiet
, diz:
sudo addgroup --system scanner
addgroup: The group 'scanner' already exists and is not a system group. Exiting.