LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 06-17-2004, 01:15 PM   #1
lennard
LQ Newbie
 
Registered: May 2003
Location: Netherlands
Posts: 8

Rep: Reputation: 0
Unhappy accidently deleted /var/log/packages


Hey all...

I was stupid enough to accidently delete my /var/log/packages dir. Does anyone have an idea how to regenerate the contents of that directory ?? (I already tried using mc's undelete-option, but it couldn't find any files anymore )


I hope someone has a good idea, so I can use Swaret again

Cheers !!

Lennard
 
Old 06-17-2004, 01:55 PM   #2
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
--edit: never mind: I'm too brain dead at the moment. Just:

If Swaret just checks the filenames, you could simply copy 'scripts' to 'packages'. That would probably be much better. Your package management will still be busted, but swaret might work. If you deleted both, you're probably going to have to suffer busted package management or reinstall.

Last edited by slakmagik; 06-17-2004 at 01:58 PM.
 
Old 06-17-2004, 02:45 PM   #3
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,617

Rep: Reputation: 136Reputation: 136
Have you the /var/swaret/.cache/PACKAGES.TXT file ?
 
Old 06-17-2004, 06:41 PM   #4
d00msweek
Member
 
Registered: Jan 2004
Location: Cebu City, Philippines
Distribution: Slackware 10,Gentoo 2005.1,LFS
Posts: 92

Rep: Reputation: 15
That is "the power of root"
 
Old 06-18-2004, 08:31 AM   #5
lennard
LQ Newbie
 
Registered: May 2003
Location: Netherlands
Posts: 8

Original Poster
Rep: Reputation: 0
Red face

Quote:
Originally posted by d00msweek
That is "the power of root"
Yeah yeah yeah !! know.....

I also posted this question on the Swaret-forum, and I got this response:

Quote:
Are you any good at writing scripts? I don't have access to a Linux box (movers deliver stuff July 12), but this is what I'd do (this is psudo code):

#!/bin/sh
wget ftp://url/to/MANIFEST.bz2
bunzip2 MANIFEST.bz2
*Need commands to strip all lines that don'e have package names or files*
TOTALLINES=`wc -l MANIFEST`
for ((COUNT=1; COUNT <= TOTALLINES ; COUNT++))
do
LINE=`sed -n $(echo $COUNT)p MANIFEST2.tmp`
if [[ "`echo $LINE | awk {'print $2'}`" == "Package:" ]];
then
PACKAGE=`basename "$LINE"`
else
echo $LINE >> /var/log/package/$PACKAGE
fi
done

That will create a fully populated /var/log/packages directory (I think). The commands to strip the MANIFEST file should involve grep.
I'm not all that good in write scripts (yet ), and the "Need commands to strip all lines ...."-part is not suit up for me. Anyone have an idea?? :-)

Thanks lads !!

Last edited by lennard; 06-18-2004 at 09:02 AM.
 
Old 06-18-2004, 10:24 AM   #6
keefaz
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,617

Rep: Reputation: 136Reputation: 136
I would do :
cd /var/swaret
installpkg *.tgz

The installation will be long but you ends with a clean /var/log/packages
The solution above is less good as it take packages infos from the MANIFEST file that not suit 100% your system, after run this sort of thing you will end with packages description for package not installed in your system.
 
Old 06-19-2004, 02:20 AM   #7
lennard
LQ Newbie
 
Registered: May 2003
Location: Netherlands
Posts: 8

Original Poster
Rep: Reputation: 0
Not an option for me...

Thanks for the reply.

This however does not seem an option for me, since I don't archive all the .tgz-files I downloaded with Swaret. I don't have a problem with making swaret I have every single package installed. I'll just remove the 'not installed' packages 'on the fly', when I see there's an update for a package I know I don't have



Cheers !!
Lennard


P.S. So, the question for me remains: "How can I strip the 'none-package'-lines from the manifest-file"

Last edited by lennard; 06-19-2004 at 02:45 AM.
 
Old 06-20-2004, 02:26 PM   #8
lennard
LQ Newbie
 
Registered: May 2003
Location: Netherlands
Posts: 8

Original Poster
Rep: Reputation: 0
Unhappy Anybody ??

Anybody an idea ??
 
Old 06-21-2004, 03:15 AM   #9
major.tom
Member
 
Registered: Jun 2003
Location: Canada
Distribution: Slackware (current); Gentoo (newbie)
Posts: 142

Rep: Reputation: 15
It's a hack, and I don't know if it'll work, but...

Do you still have the contents of /var/log/scripts? You *could* do an 'upgradepkg --reinstall' on the packages listed there. I noticed, though, that it's not an all-inclusive list (not all packages have install scripts). So it looks like it's really only half a solution to your problem.

You could go through /var/log/removed_packages and manually upgradepkg --reinstall any names appearing there that you haven't done from the previous step. This might pick up some more of them, assuming you've upgraded some packages in the past.

Or you could do a full slackware install, then remove the packages you don't want/need.

The last option is to figure out exactly what packages you have installed from the files in /bin, /usr/bin, /usr/X11R6/bin, etc and install those. 100% manual process, and still not guaranteed to be complete -- not something I would recommend.

As ugly as it is, I think the full slack install then removing what's not needed is the easiest way.

Garry

Last edited by major.tom; 06-21-2004 at 03:16 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
/var/log/packages vanished Idle Slackware 3 09-19-2005 01:57 PM
Deleted /var/log/messages, can't log any files-iptables chingyenccy Linux - Newbie 7 02-27-2005 05:03 PM
Deleted /var/log/messages, how to create a new one? chingyenccy Linux - Security 2 02-27-2005 11:06 AM
Accidentally Deleted Everything In /var/log Joe Heng Slackware 3 12-23-2004 08:20 PM
/var/log/packages gone! PurpleMotion Slackware 1 10-02-2004 04:04 PM


All times are GMT -5. The time now is 05:04 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration