it-swarm.com.de

Fehler bei jeder Installation mit jedem Dienstprogramm apt, apt-get, synaptic usw

Vor kurzem habe ich angefangen, eine ganze Reihe von Fehlern während der Installation zu bekommen. Egal, was ich installiere:

http://paste.ubuntu.com/23373166/

Aktualisieren:

OK, ich habe bis zu diesem Punkt gegraben. Ich rannte:

Sudo /usr/lib/insserv/insserv -f

Und es gab mir das:

insserv: warning: script 'showfsck' missing LSB tags and overrides
insserv: There is a loop between service reniced and showfsck if stopped
insserv:  loop involving service showfsck at depth 2
insserv:  loop involving service reniced at depth 1
insserv: Stopping showfsck depends on reniced and therefore on system facility `$all' which can not be true!
insserv: can not remove(../rc0.d/K04avahi-daemon): Permission denied
insserv: can not symlink(../init.d/avahi-daemon, ../rc0.d/K03avahi-daemon): Permission denied
insserv: can not remove(../rc1.d/K04avahi-daemon): Permission denied
insserv: can not symlink(../init.d/avahi-daemon, ../rc1.d/K03avahi-daemon): Permission denied
insserv: can not remove(../rc2.d/S08plymouth): Permission denied
insserv: can not symlink(../init.d/plymouth, ../rc2.d/S14plymouth): Permission denied
insserv: can not remove(../rc2.d/S08reniced): Permission denied
insserv: can not symlink(../init.d/reniced, ../rc2.d/S14reniced): Permission denied
insserv: can not remove(../rc2.d/S08grub-common): Permission denied
insserv: can not symlink(../init.d/grub-common, ../rc2.d/S14grub-common): Permission denied
insserv: can not remove(../rc2.d/S08ondemand): Permission denied
insserv: can not symlink(../init.d/ondemand, ../rc2.d/S14ondemand): Permission denied
insserv: can not remove(../rc2.d/S08rc.local): Permission denied
insserv: can not symlink(../init.d/rc.local, ../rc2.d/S14rc.local): Permission denied
insserv: can not remove(../rc3.d/S08plymouth): Permission denied
insserv: can not symlink(../init.d/plymouth, ../rc3.d/S14plymouth): Permission denied
insserv: can not remove(../rc3.d/S08reniced): Permission denied
insserv: can not symlink(../init.d/reniced, ../rc3.d/S14reniced): Permission denied
insserv: can not remove(../rc3.d/S08grub-common): Permission denied
insserv: can not symlink(../init.d/grub-common, ../rc3.d/S14grub-common): Permission denied
insserv: can not remove(../rc3.d/S08ondemand): Permission denied
insserv: can not symlink(../init.d/ondemand, ../rc3.d/S14ondemand): Permission denied
insserv: can not remove(../rc3.d/S08rc.local): Permission denied
insserv: can not symlink(../init.d/rc.local, ../rc3.d/S14rc.local): Permission denied
insserv: can not remove(../rc4.d/S08plymouth): Permission denied
insserv: can not symlink(../init.d/plymouth, ../rc4.d/S14plymouth): Permission denied
insserv: can not remove(../rc4.d/S08reniced): Permission denied
insserv: can not symlink(../init.d/reniced, ../rc4.d/S14reniced): Permission denied
insserv: can not remove(../rc4.d/S08grub-common): Permission denied
insserv: can not symlink(../init.d/grub-common, ../rc4.d/S14grub-common): Permission denied
insserv: can not remove(../rc4.d/S08ondemand): Permission denied
insserv: can not symlink(../init.d/ondemand, ../rc4.d/S14ondemand): Permission denied
insserv: can not remove(../rc4.d/S08rc.local): Permission denied
insserv: can not symlink(../init.d/rc.local, ../rc4.d/S14rc.local): Permission denied
insserv: can not remove(../rc5.d/S08plymouth): Permission denied
insserv: can not symlink(../init.d/plymouth, ../rc5.d/S14plymouth): Permission denied
insserv: can not remove(../rc5.d/S08reniced): Permission denied
insserv: can not symlink(../init.d/reniced, ../rc5.d/S14reniced): Permission denied
insserv: can not remove(../rc5.d/S08grub-common): Permission denied
insserv: can not symlink(../init.d/grub-common, ../rc5.d/S14grub-common): Permission denied
insserv: can not remove(../rc5.d/S08ondemand): Permission denied
insserv: can not symlink(../init.d/ondemand, ../rc5.d/S14ondemand): Permission denied
insserv: can not remove(../rc5.d/S08rc.local): Permission denied
insserv: can not symlink(../init.d/rc.local, ../rc5.d/S14rc.local): Permission denied
insserv: can not remove(../rc6.d/K04avahi-daemon): Permission denied
insserv: can not symlink(../init.d/avahi-daemon, ../rc6.d/K03avahi-daemon): Permission denied
insserv: fopen(.depend.stop): Permission denied
3
igoryonya

OK, nachdem ich viel an den Haaren gezogen und tiefer gegraben habe, habe ich endlich das Problem gefunden:

Es scheint, dass insserv auf einige Dienste stößt, daher habe ich alle Dienste, die insserv beanstandet hat, in ein vorübergehend erstelltes Verzeichnis verschoben: /etc/d.init von /etc/init.d. Dann habe ich Sudo dpkg --configure -a und voila, es hat fast fehlerfrei funktioniert. Ich habe es noch ein paar Mal ausgeführt, bis alle Fehler verschwunden sind.

Danach habe ich Sudo apt-get -f install nur um sicher zu gehen, dass nichts mehr übrig ist.

Dann habe ich angefangen, die Configs in problematischen Paketen neu zu installieren und zurückzusetzen. Nach und nach kam ich auf folgendes Skript:

#!/bin/sh

#First, manually move problematic services from init.d to d.init (i.e.: /etc/d.init/)
cd /etc

var_srv=$1
var_pkg=$(dpkg-query -S init.d/$var_srv|egrep -o '^.*\:'|egrep -o '^.*[^\:]')

#To Reinstall the problematic package:
Sudo aptitude reinstall $var_pkg
#To Restore missing configs:
Sudo apt-get -o DPkg::options::=--force-confmiss --reinstall install $var_pkg

#Show that both (the backup copy and the newly created copy exist):
ls d.init/$var_srv init.d/$var_srv
#Show the difference between 2 files (the new and the backup):
meld d.init/$var_srv init.d/$var_srv
Sudo rm -vi d.init/$var_srv

#To show what files have left for processing
find d.init/|sort

Beim Vergleich ist mir aufgefallen, dass die showfsck-Datei nicht den erforderlichen Header enthält, über den ich in den Foren gelesen habe. Alle init.d-Skripte müssen den folgenden Header haben:

### BEGIN INIT INFO
# Provides:
# Required-Start:
# Required-Stop:
# Should-Start:
# Should-Stop:
# X-Start-Before:
# X-Stop-After:
# Default-Start:
# Default-Stop:
# Short-Description:
# Description:
### END INIT INFO

Ich wusste nicht, welche Werte es haben sollte, also ließ ich sie leer. Meine Installation funktioniert jetzt ohne Fehler.

4
igoryonya