|
| |
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
| |
Troubleshooting: |
|
Name: Besucher.
Online: 12 aktive User.
|
| Login |
Logout
|
|
|
Benachrichtigen bei Änderungen: |
|
|
|
|
Debian GNU/Linux 3.1 »Sarge«,
mit Debian-Anwenderhandbuch.

DVD-ROM +
Bonus-DVD
EUR
49,90
(versandkostenfrei)
|
Debian GNU/Linux Power Pack.
von
Peter H. Ganten und
Wulf Alex.

946 Seiten, zwei DVDs
EUR 69,95
(versandkostenfrei) |
Ubuntu: |
Ubuntu/Kubuntu 5.10,
mit Handbuch.

EUR
29,90
(versandkostenfrei)
|
SuSE
Linux: |
SUSE
Linux 10.0 deutsch.
von Novell

EUR
48,95
(versandkostenfrei)
|
SuSE
Linux 9.3 Professional
von Novell.

EUR
82,99
(versandkostenfrei)
|
SuSE
Linux 9.3 Professional Update.
von Novell

EUR 59,95
(versandkostenfrei) |
Red
Hat Linux: |
|
Red Hat Linux
Professional Workstation.

EUR 99,95
(versandkostenfrei)
|
Red Hat Linux 9 Personal.
Red Hat Linux 9 Professional.

ab EUR 39,99
(versandkostenfrei) |
|
 |
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. |
 |
|
|