Debian – Debconf broke after system failure

debconfdebiandebian-wheezy

I have some serious problems with one of my web servers running debian wheezy. It seem that last week the server center had an error which caused the machine to shutdown suddenly.

Since then some files seem to have gone corrupt.

sudo apt-get install -f
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.       
Statusinformationen werden eingelesen.... Fertig
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 26 nicht aktualisiert.
2 nicht vollständig installiert oder entfernt.
Es müssen noch 0 B von 1.518 kB an Archiven heruntergeladen werden.
Nach dieser Operation werden 0 B Plattenplatz zusätzlich benutzt.
debconf: Perl may be unconfigured (Can't locate Debconf/Log.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at (eval 1) line 4.
BEGIN failed--compilation aborted at (eval 1) line 4.
) -- aborting
dpkg: Fehler beim Bearbeiten von perl-base (--configure):
 Paket perl-base ist nicht bereit zur Konfiguration
 kann nicht konfiguriert werden (momentaner Status »half-installed«)
man-db (2.6.2-1) wird eingerichtet ...
/var/lib/dpkg/info/man-db.postinst: 3: .: Can't open /usr/share/debconf/confmodule
dpkg: Fehler beim Bearbeiten von man-db (--configure):
 Unterprozess installiertes post-installation-Skript gab den Fehlerwert 2 zurück
Fehler traten auf beim Bearbeiten von:
 perl-base
 man-db
E: Sub-process /usr/bin/dpkg returned an error code (1)

Here it seems that perl is unconfigured and that man-db has some problems. I'm not able to install any system or software update.

I first had problems with glibc6 and reinstalled it from dpkg archive folder.

But the main cause seems to be that /usr/share/debconfdirectory is completely gone!

Does anyone have any suggestions on how I could 'save' that server and repair the system without a complete new installation ?
Any help would be appreciated!

System Info

uname -a
Linux wn-main-debian 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux

Best Answer

Ok, I found a working 'solution' which means that error above has gone away. I don't know if there are other errors that will come up. But for now this works and helps me backup everything.

Basically I install perl-base and debconf from archives folder.

/var/cache/apt/archives$ ls -als | grep perl
1484 -rw-r--r-- 1 root root 1517844 Sep 30 06:11 perl-base_5.14.2-21+deb7u1_amd64.deb

/var/cache/apt/archives$ sudo dpkg -i perl-base_5.14.2-21+deb7u1_amd64.deb 
(Lese Datenbank ... 44661 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Ersetzen von perl-base 5.14.2-21+deb7u1 (durch perl-base_5.14.2-21+deb7u1_amd64.deb) ...
Ersatz für perl-base wird entpackt ...
perl-base (5.14.2-21+deb7u1) wird eingerichtet ...

/var/cache/apt/archives$ ls -als | grep debconf
 168 -rw-r--r-- 1 root root  171018 Dez 26  2012 debconf_1.5.49_all.deb

/var/cache/apt/archives$ sudo dpkg -i debconf_1.5.49_all.deb 
(Lese Datenbank ... 44661 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Ersetzen von debconf 1.5.49 (durch debconf_1.5.49_all.deb) ...
Ersatz für debconf wird entpackt ...
debconf (1.5.49) wird eingerichtet ...