dpkg não instalará nenhum pacote

1

Estou em apuros com o meu Ubuntu 13.04. O Ubuntu parou o suporte do 13.04, então adicionei o repositório wheezy ao sources.list e atualizei meu sistema. Depois disso, não posso instalar nenhum pacote nem atualizar meu sistema. Eu tentei muitas coisas como

apt-get install -f

sem sorte.  Eu abro meu comp por USB ao vivo e chroot para o sistema quebrado.

Continuo recebendo uma longa mensagem de erro quando tento instalar um pacote

  The following extra packages will be installed:   util-linux
Suggested packages:   util-linux-locales kbd console-tools The
following NEW packages will be installed:   util-linux 0 upgraded, 1
newly installed, 0 to remove and 0 not upgraded. 10 not fully
installed or removed. Need to get 0 B/618 kB of archives. After this
operation, 1,590 kB of additional disk space will be used. Do you
want to continue [Y/n]?  Preconfiguring packages ... (Reading
database ... 588796 files and directories currently installed.)
Unpacking util-linux (from
.../util-linux_2.20.1-5.1ubuntu8.1_i386.deb) ... initctl: Unknown
job: K02screen-cleanup insserv: warning: script 'K02screen-cleanup'
missing LSB tags and overrides insserv: warning: script
'K02acpi-support' missing LSB tags and overrides initctl: Unknown
job: K02screen-cleanup initctl: Unknown job: S02screen-cleanup
insserv: Script martian is broken: incomplete LSB comment. insserv:
missing 'Required-Start:' entry: please add even if empty. insserv:
missing 'Required-Stop:'  entry: please add even if empty. insserv:
missing 'Default-Stop:'   entry: please add even if empty. initctl:
Unknown job: S02screen-cleanup insserv: Script martian is broken:
incomplete LSB comment. insserv: missing 'Required-Start:' entry:
please add even if empty. insserv: missing 'Required-Stop:'  entry:
please add even if empty. insserv: missing 'Default-Stop:'   entry:
please add even if empty. initctl: Unknown job: S02screen-cleanup
insserv: Script martian is broken: incomplete LSB comment. insserv:
missing 'Required-Start:' entry: please add even if empty. insserv:
missing 'Required-Stop:'  entry: please add even if empty. insserv:
missing 'Default-Stop:'   entry: please add even if empty. initctl:
Unknown job: S02screen-cleanup insserv: Script martian is broken:
incomplete LSB comment. insserv: missing 'Required-Start:' entry:
please add even if empty. insserv: missing 'Required-Stop:'  entry:
please add even if empty. insserv: missing 'Default-Stop:'   entry:
please add even if empty. initctl: Unknown job: K02screen-cleanup
initctl: Unknown job: S02procps insserv: warning: script 'S02procps'
missing LSB tags and overrides initctl: Unknown job: S01udev
insserv: warning: script 'S01udev' missing LSB tags and overrides
insserv: Script martian is broken: incomplete LSB comment. insserv:
missing 'Required-Start:' entry: please add even if empty. insserv:
missing 'Required-Stop:'  entry: please add even if empty. insserv:
missing 'Default-Stop:'   entry: please add even if empty. insserv:
Default-Stop  undefined, assuming empty stop  runlevel(s) for script
'martian' insserv: warning: script 'network-interface-security'
missing LSB tags and overrides insserv: Default-Start undefined,
assuming empty start runlevel(s) for script
'network-interface-security' insserv: Default-Stop  undefined,
assuming empty stop  runlevel(s) for script
'network-interface-security' insserv: warning: script
'plymouth-splash' missing LSB tags and overrides insserv:
Default-Start undefined, assuming empty start runlevel(s) for script
'plymouth-splash' insserv: Default-Stop  undefined, assuming empty
stop  runlevel(s) for script 'plymouth-splash' insserv: warning:
script 'plymouth' missing LSB tags and overrides insserv:
Default-Start undefined, assuming empty start runlevel(s) for script
'plymouth' insserv: Default-Stop  undefined, assuming empty stop 
runlevel(s) for script 'plymouth' insserv: warning: script
'plymouth-ready' missing LSB tags and overrides insserv:
Default-Start undefined, assuming empty start runlevel(s) for script
'plymouth-ready' insserv: Default-Stop  undefined, assuming empty
stop  runlevel(s) for script 'plymouth-ready' insserv: warning:
script 'screen-cleanup' missing LSB tags and overrides insserv:
warning: script 'squid3' missing LSB tags and overrides insserv:
Default-Start undefined, assuming empty start runlevel(s) for script
'squid3' insserv: Default-Stop  undefined, assuming empty stop 
runlevel(s) for script 'squid3' insserv: warning: script
'networking' missing LSB tags and overrides insserv: Default-Start
undefined, assuming empty start runlevel(s) for script 'networking'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s)
for script 'networking' insserv: warning: script
'udev-fallback-graphics' missing LSB tags and overrides insserv:
Default-Start undefined, assuming empty start runlevel(s) for script
'udev-fallback-graphics' insserv: Default-Stop  undefined, assuming
empty stop  runlevel(s) for script 'udev-fallback-graphics' insserv:
warning: script 'network-interface' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s)
for script 'network-interface' insserv: Default-Stop  undefined,
assuming empty stop  runlevel(s) for script 'network-interface'
insserv: warning: script 'plymouth-log' missing LSB tags and
overrides insserv: Default-Start undefined, assuming empty start
runlevel(s) for script 'plymouth-log' insserv: Default-Stop 
undefined, assuming empty stop  runlevel(s) for script
'plymouth-log' insserv: warning: script 'udevtrigger' missing LSB
tags and overrides insserv: Default-Start undefined, assuming empty
start runlevel(s) for script 'udevtrigger' insserv: Default-Stop 
undefined, assuming empty stop  runlevel(s) for script 'udevtrigger'
insserv: warning: script 'nagios' missing LSB tags and overrides
insserv: warning: script 'rsyslog' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s)
for script 'rsyslog' insserv: Default-Stop  undefined, assuming
empty stop  runlevel(s) for script 'rsyslog' insserv: warning:
script 'kmod' missing LSB tags and overrides insserv: Default-Start
undefined, assuming empty start runlevel(s) for script 'kmod'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s)
for script 'kmod' insserv: warning: script 'procps' missing LSB tags
and overrides insserv: Default-Stop  undefined, assuming empty stop 
runlevel(s) for script 'procps' insserv: warning: script 'mongodb'
missing LSB tags and overrides insserv: Default-Start undefined,
assuming empty start runlevel(s) for script 'mongodb' insserv:
Default-Stop  undefined, assuming empty stop  runlevel(s) for script
'mongodb' insserv: warning: script 'avahi-daemon' missing LSB tags
and overrides insserv: Default-Start undefined, assuming empty start
runlevel(s) for script 'avahi-daemon' insserv: Default-Stop 
undefined, assuming empty stop  runlevel(s) for script
'avahi-daemon' insserv: warning: script 'plymouth-stop' missing LSB
tags and overrides insserv: Default-Start undefined, assuming empty
start runlevel(s) for script 'plymouth-stop' insserv: Default-Stop 
undefined, assuming empty stop  runlevel(s) for script
'plymouth-stop' insserv: warning: script 'udev' missing LSB tags and
overrides insserv: Default-Stop  undefined, assuming empty stop 
runlevel(s) for script 'udev' insserv: warning: script
'acpi-support' missing LSB tags and overrides insserv: warning:
script 'udev-finish' missing LSB tags and overrides insserv:
Default-Start undefined, assuming empty start runlevel(s) for script
'udev-finish' insserv: Default-Stop  undefined, assuming empty stop 
runlevel(s) for script 'udev-finish' insserv: warning: script
'network-interface-container' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s)
for script 'network-interface-container' insserv: Default-Stop 
undefined, assuming empty stop  runlevel(s) for script
'network-interface-container' insserv: warning: script
'plymouth-upstart-bridge' missing LSB tags and overrides insserv:
Default-Start undefined, assuming empty start runlevel(s) for script
'plymouth-upstart-bridge' insserv: Default-Stop  undefined, assuming
empty stop  runlevel(s) for script 'plymouth-upstart-bridge'
insserv: warning: script 'udevmonitor' missing LSB tags and
overrides insserv: Default-Start undefined, assuming empty start
runlevel(s) for script 'udevmonitor' insserv: Default-Stop 
undefined, assuming empty stop  runlevel(s) for script 'udevmonitor'
insserv: There is a loop between service tlp and nagios if stopped
insserv:  loop involving service nagios at depth 2 insserv:  loop
involving service tlp at depth 1 insserv: Stopping nagios depends on
tlp and therefore on system facility '$all' which can not be true!
insserv: exiting now without changing boot order! update-rc.d:
error: insserv rejected the script header dpkg: error processing
/var/cache/apt/archives/util-linux_2.20.1-5.1ubuntu8.1_i386.deb
(--unpack):  subprocess new pre-installation script returned error
exit status 1 Errors were encountered while processing: 
/var/cache/apt/archives/util-linux_2.20.1-5.1ubuntu8.1_i386.deb E:
Sub-process /usr/bin/dpkg returned an error code (1)

Como posso recuperar meu sistema?

dpkg --audit The following packages have been unpacked but not yet configured. They must be configured using dpkg --configure or the configure menu option in dselect for them to work: initramfs-tools tools for generating an initramfs module-init-tools transitional dummy package (module-init-tools to kmod) procps /proc file system utilities ifupdown high level tools to configure network interfaces mountall filesystem mounting tool kmod tools for managing Linux kernel modules plymouth graphical boot animation and logger - main package upstart event-based init daemon initscripts scripts for initializing and shutting down the system udev rule-based device node and kernel event manager

=============================================== =========================

    
por kenn 15.03.2014 / 15:19

1 resposta

3

Após horas de luta, recuperei meu sistema operacional. Eu abri meu comp por USB ao vivo, em seguida, do terminal eu corro

sudo blkid

para verificar o número da partição da minha instalação, está em sda6

sudo mount /dev/sda6 /mnt

sudo mount --bind /dev /mnt/dev && sudo mount --bind /dev/pts /mnt/dev/pts && sudo mount --bind /proc /mnt/proc && sudo mount --bind /sys /mnt/sys

sudo chroot /mnt

no começo eu corro

apt-get clean 

para limpar o cache

apt-get update

Desde a última atualização borked meu sistema eu tentei

dpkg --configure -a && apt-get -f install

mas não funcionou devido ao erro do insserv, conforme eu postei na minha pergunta. Eu encontrei a causa do erro. Eu naveguei para /etc/init.d e verifiquei todos os scripts, se eles tiverem LSB keyword section , porque a causa do erro estava faltando LSB keyword section like

 #!/bin/sh

 ### BEGIN INIT INFO
 # Provides:          
 # Required-Start:    
 # Required-Stop:
 # Should-Start:
 # Default-Start:    
 # Default-Stop:
 # Short-Description: PowerPanel to monitor CyberPower UPS
 ### END INIT INFO

Os scripts antigos não tinham essa seção, depois que eu adicionei essa seção aos scripts antigos e executei

 dpkg --configure -a

Eu me livrei desse maldito erro.

Mais tarde, peguei a lista de pacotes atualizados e removidos com

 cat /var/log/dpkg.log |grep remove| awk ' { print $4 } ' | awk -F ':' ' { print $1 } ' | tr '\n' ' '  >listrem

 cat /var/log/dpkg.log |grep upgrade| awk ' { print $4 } ' | awk -F ':' ' { print $1 } ' | tr '\n' ' '  >listupgr

finalmente eu instalei pacotes removidos com

apt-get install $(grep -vE "^\s*#" listrem)

e reinstalado os pacotes atualizados com

apt-get install --reinstall $(grep -vE "^\s*#" listupgr)

Quando eu reinicio

"Sim, minha linda área de trabalho está de volta!"

    
por 15.03.2014 / 22:28

Tags