I've trashed my slackpkgs and need help!
I ran a program (vbetool) which somehow trashed numerous sector of my hard drive. fsck was finding too many problems. So, I wiped the drive and restored from a full backup of two weeks ago, then a differential backup from yesterday. I noticed some problems (couldn't find firefox) and saw that e.g. /usr/bin/firefox was linked to the wrong version executable. Hmmm. So, I ran `slackpkg upgrade firefox'.
That gave me a list of package errors and asked if I wanted to remove or ignore. I answered "remove", which then proceeded to remove LOTS of packages, most of which I actually needed. running 'slackpkg upgrade-all' wouldn't do anything. To get slackpkg to do anything at all (slackpkg update) I had to copy cp, scp, wget, libssl.so.1 and libcrypto.so.l from another system. I've since probably compounded the problem. I renamed existing and created empty /var/log/packages and /var/lib/slackpkg directories. Re-ran 'slackpkg update' (which appeared to work), then tried 'slackpkg upgrade-all' again. That gives me: Code:
# slackpkg upgrade-all |
backup && reinstall from scratch, formatting at least the root partition with an ext4 file system.
|
I was able to work around this problem. I could do e.g. 'slackpkg install openssl' and it would work and put that one package into /var/log/packages.
So, I listed the packages in /var/log/packages from my end-of-month full backup, then listed the newer packages from the most recent differential. Then did 'comm -3 olderPkgs newerPkgs' which produced a merged list like: Code:
/var/log/packages/ModemManager-1.4.14-x86_64-1 Code:
egrep -v "^#|SBo*|alien" doit | cut -d/ -f5 | while read; do slackpkg -postinst=off -dialog=off -batch=on -default_answer=y -spinning=off install "$REPLY"; done Lesson: When doing a restore to a wiped disk from a full plus differential backup, do the restore per normal. When doing the differential, restore everything excluding the /var/log/packages directory (tar --exclude /var/log/packages). Then, go through the list of new packages (tar -tvf tarfile | grep var/log/packages) and manually upgrade each one. ALSO - it would be a very good idea to do a full backup after any package update! That would have saved me the trouble in the first place. |
I would also plug BTRFS here and having your root inside a subvolume. That way you can make a snapshot before you upgrade packages. If a package upgrade does not go well rolling back is as easy as passing subvolume=xx param for your rootfs argument in ELILO at boot time.
BTRFS also is probably the easiest way to make full backups of a stand alone Linux box now and everything need to restore to bear metal is on the Slackware install CD. |
Thanks for the BTRFS info chemfire. I'm reading about that now and perhaps will stage that on a test platform at some point.
|
All times are GMT -5. The time now is 11:55 PM. |