Kefk Network Home Kefk Network : Kefk Network GNU/Linux GNU/Linux | Über Kefk Network GNU/Linux About | Kefk Network GNU/Linux Wiki Wiki. Changelog | Index | Inhalt | Site Map | Suchen
Administration | Akteure | Anwendungen | Berlin | Business | Chronik | Counter | Desktop | Development | Distributionen | Dokumentation | Hardware | Jobs | Kernel | Lernen | Literatur | Meinung | Microsoft Windows | Netmarks | News | PDA | Praxis | Reviews | Server | Shell | Shopping | Software | Standards | Tagebuch | Theorie | Window Manager | Worldwide | X11.

 

Troubleshooting der Debian-Paketverwaltung

Ihr Benutzername: Besucher
Wer ist gerade online? - 12 aktive User.

Erstellt/Bearbeitet: 01-Oct-2005/07-Jan-06
Systemzeit: Samstag, 05.07.2008, 15:04:06.

Kefk Network Home : Linux : Administration : Paketverwaltung : DEB : Troubleshooting


Übersicht

Gelegentlich kommt es auch bei einem Debian-System vor, dass APT bzw. aptitude oder dselect nicht mehr mitspielen wollen. Ich hatte ein solches Problem auf meinem Mail-Gateway, als eine Festplatte plötzlich defekte Sektoren hatte (jaja, mit den Smartmontools wäre das vielleicht nicht so unerwartet passiert) und die Paketdatenbank zerschrotet war. Das schier unglaubliche an Debian ist, dass es selbst bei einem fehlenden /var/lib/dpkg noch möglich ist, den Rechner zu retten – ob das in jedem Fall sinnvoll ist, sei einmal dahingestellt; in meinem Fall wäre das Neuaufsetzen jedenfalls erheblich aufwändiger gewesen.

Karsten M. Self und andere haben ein Rettungsskript geschrieben, das in vielen extremen Fällen weiterhelfen kann. In meinem Fall lief das Skript nicht ohne Anpassungen durch, ich konnte es aber für mein spezielles Sorgenkind letzlich dann doch nach einiger Bastelei erfolgreich nutzen.

Außerdem sind die Rettungsschritte in Karstens Skript ziemlich modular aufgebaut, so dass man sie ggf. auch sukzessive von Hand abarbeiten kann.

Mein Mail-Gateway läuft jedenfalls mittlerweile wieder und hat im September 2005 auch problemlos ein Upgrade von »Woody« auf »Sarge« mitgemacht..

Recovery-Skript

#!/bin/sh
# Recovering a Debian system without any backup of /var/lib/dpkg.
# ref: http://www.linuxworld.com/2003/0113.petreley.html
# (C) 2003, Karsten M. Self kmself@ix.netcom.com
# (C) 2003, Osamu Aoki osamu@debian.org, (fixup)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA

export PATH=/usr/sbin:/usr/bin:/sbin:/bin

# Let's be verbose....
set -v

# Test existence of any subdirs in /var. If they exist, exit, otherwise
# risk destroying an active system. If they don't exist, the remainder
# of this script is safe.

function create_new_dir () {
if [ ! -f $1 && ! -d $1 ]
then mkdir $1
else
echo "$1 exists, aborting" 1>&2
exit 1
fi
}

for d in /var/log /var/cache/{debconf,apt/archives} \
/var/lib/dpkg/{info,parts,alternatives,methods,updates}
do
create_new_dir $d
done

# Create a rudimentary status file
cat <<-EOF>/var/lib/dpkg/status
Package: libc6
Status: install ok installed
Version: 2.3.1-9
EOF

# Update package cache
apt-get update
apt-get dist-upgrade

# Register as installed crucial packages.
dpkg --clear-avail
apt-get update
apt-get dist-upgrade
cd /var/cache/apt/archives
dpkg -i libncurses*
dpkg -i perl-base*
dpkg -i libstdc++*
dpkg -i dselect*
dpkg -i dpkg*

# Reinstall libc to register it.
apt-get install --reinstall libc6

# Reinstall base packages.
apt-get dist-upgrade

# Generate list of installed packages to Re-register previously
# installed packages as installed, using /usr/share/doc as a
# fallback package registry.
# ref: dpkg -l $( ls /usr/share/doc | grep -v [A-Z] ) >/dev/null

dpkg --set-selections < $(
ls /usr/share/doc | \
grep -v [A-Z] | \
grep -v '^texmf$' | \
grep -v '^debian$' | \
awk '{print $1 " install"}'
)

# Re-register everything.
apt-get -u dselect-upgrade

## End of script ##

Netmarks

Linuxworld.com - Retten eines Debian-Systems ohne Backup von /var/lib/dpkg,
www.linuxworld.com/2003/0113.petreley.html [01-Oct-2005: Ressource offline].

Karsten M. Self et al.: Recovering Debian without /var/lib/dpkg,
linuxmafia.com/faq/Debian/package-database-rebuild.html.

Osamu Aoki et al.: Debian Reference,
qref.sourceforge.net/Debian/reference/ch-package.en.html#s-recover-status.

Anmerkungen

Forum: (Anmerkungen in diesem Forum: )

Neue Anmerkung verfassen
Darstellungsmodus : Alle | Voransicht | Nur Titel | Aktualisieren
Besuchen Sie 2eNetWorX und Open Source & Free Software für weitere freie Software-Projekte unter Win32.

Troubleshooting:
Nach oben
Wer ist online?
Name: Besucher.
Online: 12 aktive User.
Login | Logout
Monitoring:
Benachrichtigen bei Änderungen:

mi.gif (12x15 -- 70 bytes)Top-Distributionen:
Debian GNU/Linux 3.1 »Sarge«,
mit Debian-Anwenderhandbuch.


DVD-ROM +
Bonus-DVD
amazon_small.gif (55x15 -- 576 bytes)EUR 49,90
(versandkostenfrei)


Debian GNU/Linux Power Pack.
von Peter H. Ganten und Wulf Alex.

3540432507.03.MZZZZZZZ.jpg (93x140 -- 3556 bytes)
946 Seiten, zwei DVDs
amazon_small.gif (55x15 -- 576 bytes)EUR 69,95
(versandkostenfrei)

mi.gif (12x15 -- 70 bytes)Ubuntu:
Ubuntu/Kubuntu 5.10,
mit Handbuch.


amazon_small.gif (55x15 -- 576 bytes)EUR 29,90
(versandkostenfrei)


mi.gif (12x15 -- 70 bytes)SuSE Linux:
SUSE Linux 10.0 deutsch.
von Novell


amazon_small.gif (55x15 -- 576 bytes)EUR 48,95
(versandkostenfrei)


SuSE Linux 9.3 Professional
von Novell.


amazon_small.gif (55x15 -- 576 bytes)EUR 82,99
(versandkostenfrei)


SuSE Linux 9.3 Professional Update.
von Novell


amazon_small.gif (55x15 -- 576 bytes)EUR 59,95
(versandkostenfrei)

mi.gif (12x15 -- 70 bytes)Red Hat Linux:
Red Hat Linux Professional Workstation.

3827207525.03.MZZZZZZZ.jpg (134x150 -- 5811 bytes)
amazon_small.gif (55x15 -- 576 bytes)EUR 99,95
(versandkostenfrei)


Red Hat Linux 9 Personal.
Red Hat Linux 9 Professional.

3827207479.03.MZZZZZZZ.jpg (116x140 -- 3312 bytes)
amazon_small.gif (55x15 -- 576 bytes)ab EUR 39,99
(versandkostenfrei)

mi.gif (12x15 -- 70 bytes)Literaturhinweise:
Linux Administration Handbook
von Evi Nemeth, Garth Snyder u.a.

0130084662.03.MZZZZZZZ.jpg (104x140 -- 6538 bytes)

Englische Originalausgabe - 850 Seiten - 2002
amazon_small.gif (55x15 -- 576 bytes)EUR 49,90 (versandkostenfrei)
Deutsche Ausgabe - 998 Seiten - 2003
amazon_small.gif (55x15 -- 576 bytes)EUR 39,95 (versandkostenfrei)


The Linux Cookbook
von Michael Stutz

1886411484.01.MZZZZZZZ.jpg (110x140 -- 6489 bytes)
Englische Originalausgabe - 306 Seiten - 2001
amazon_small.gif (55x15 -- 576 bytes)EUR 36,50 (versandkostenfrei)

Linux Cookbook
von Carla Schroder
Englische Originalausgabe (O'Reilly)
553 Seiten - 2004
amazon_small.gif (55x15 -- 576 bytes)EUR 40,90 (versandkostenfrei)


Linux Rute User's Tutorial and Exposition
von Paul Sheer

0130333514.01.MZZZZZZZ.jpg (106x140 -- 6836 bytes)
amazon_small.gif (55x15 -- 576 bytes)
Englische Originalausgabe - 630 Seiten - 2001

mi.gif (12x15 -- 70 bytes)Amazon.de:
Suchen in:
Suchbegriffe:
Über Amazon.de
Kefk Network:
Thematisch verwandte Subsites:
Apple, BSD, Hardware, Internet, Microsoft Windows, Networking, Open Content, Open Source & Free Software, Politik, Recht, Safety, Security, Shopping, Software, The Tark, Webworking, Wissen.
Kefk Network Home
Hacker Emblem glider.png (55x55 -- 724 bytes)

 

URL: http://www.kefk.net/Linux/Administration/Paketverwaltung/DEB/Troubleshooting/index.asp.
Translate this page to   Service provided by Google.
Website: About | Index | Inhalt | Site Map | Suchen | Wer ist online? | What's new?.
Thematisch verwandte Subsites: Apple | BSD | Open Source | Project »Tark« | Software | UNIX | Windows | Wissen.
Mirrors: Connected | DAHB | Debian-Howto | Jargon File | Linuxfibel | Linux-Buch | RUTE | SelfLinux | TeX.
Ergänzungen, Kommentare und Fragen: Kontakt | Foren | Wiki.
E-Mail: echo "asb at keNOSPAMfk.net"| sed -e "s/ at /@/" -e "s/NOSPAM//".
Registered Linux user: #34377 <http://counter.li.org>.
  Copyright | Credits | Disclaimer | Impressum | Rechtliche Hinweise | Wayback Machine.