LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-21-2018, 01:54 AM   #1
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Rep: Reputation: 177Reputation: 177
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

Checking local integrity... DONE
ls: cannot access '/var/log/packages/*': No such file or directory
Looking for packages to upgrade. Please wait... DONE

No packages match the pattern for upgrade. Try:

        /usr/sbin/slackpkg install|reinstall
Perhaps I've already fatally killed my system, but is there a possibility I can recover from this? How?

Last edited by mfoley; 03-21-2018 at 01:56 AM.
 
Old 03-21-2018, 03:21 AM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,057

Rep: Reputation: Disabled
backup && reinstall from scratch, formatting at least the root partition with an ext4 file system.

Last edited by Didier Spaier; 03-21-2018 at 03:23 AM.
 
Old 03-22-2018, 08:53 AM   #3
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Original Poster
Rep: Reputation: 177Reputation: 177
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
/var/log/packages/NetworkManager-1.2.2-x86_64-2
        /var/log/packages/NetworkManager-1.8.4-x86_64-1_slack14.2
/var/log/packages/PyQt-4.11.4-x86_64-1
:
:
where the indented line is from the differential backup and therefore the newer package. I hand-edited this resulting file (which I called doit) and removed the older package (in the above example I removed the NetworkManager-1.2.2-x86_64-2 line). This wasn't that tedious as there were only 44 newer packages. I then ran the following command to install each package:
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
and rebooted. All was well!

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.
 
Old 03-26-2018, 08:44 AM   #4
chemfire
Member
 
Registered: Sep 2012
Posts: 422

Rep: Reputation: Disabled
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.
 
2 members found this post helpful.
Old 03-28-2018, 11:24 PM   #5
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Original Poster
Rep: Reputation: 177Reputation: 177
Thanks for the BTRFS info chemfire. I'm reading about that now and perhaps will stage that on a test platform at some point.
 
  


Reply

Tags
slackpkg



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Really trashed disk swamp-dog Linux - Newbie 3 10-01-2010 08:50 AM
Trashed DVD+RW tpreitzel Linux - General 7 08-15-2009 10:59 PM
I trashed my trash! jsoulejr Linux - Desktop 3 02-01-2007 01:02 AM
hdd trashed lackluster Linux - Hardware 10 02-27-2003 12:40 AM
Trashed Grub -- Help! (RH8.0) Fredf Linux - Newbie 6 11-22-2002 07:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration