Unix Technical Forum

deleted /var/log/packages

This is a discussion on deleted /var/log/packages within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> Ioannis A. bouhras <ioabuh@unixfor.gr> wrote: > Grant Coady wrote: > > > > > On Wed, 08 Jun 2005 ...


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #11 (permalink)  
Old 02-20-2008, 09:09 AM
usenet@isbd.co.uk
 
Posts: n/a
Default Re: deleted /var/log/packages

Ioannis A. bouhras <ioabuh@unixfor.gr> wrote:
> Grant Coady wrote:
>
> >
> > On Wed, 08 Jun 2005 11:05:56 +0200, Lars Behrens <Spam.Buster@web.de>
> > wrote:
> >> > Should contain most if not all the packages.
> >>
> >> Thanks, but I deleted the whole log directory.

> >
> > So back it up next time Didn't break machine, just made future
> > admin of box a little more interesting. Stuff happens.
> > --Grant.

>
> So, next time ..... .bashrc
>
> alias rm='rm -i'
> alias cp='cp -i'
> alias mv='mv -i'
>


.... and from then on you automatically hit 'y' every time you run one
of these commands, in my experience these aliases are just a nuisance,
I always remove them from systems where it has been "done for me".

--
Chris Green

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 02-20-2008, 09:10 AM
Lars Behrens
 
Posts: n/a
Default Re: deleted /var/log/packages

Grant Coady wrote:

>> Me too. But honestly I simply didn't think of the packages branch,
>> neither when setting up the backup nor when deleting the log directory.

>
> symlinked --Grant.


?? :-\

--
Cheerz Lars
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 02-20-2008, 09:10 AM
+Alan Hicks+
 
Posts: n/a
Default Re: deleted /var/log/packages

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

In alt.os.linux.slackware, Loki Harfagr dared to utter,
> A quick idea, if you have a slackware deposit or if you mount
> the install cd, cd to the slackware/ dir and check like yhis :
> # upgradepkg --dry-run ap/*.tgz |grep '(already installed).$' |cut -d' ' -f1
>
> would list the ap/ packages you installed.


Did you actually try this? It won't work. upgradepkg relies entirely
on the existance of files inside /var/log/packages and does no other
checking to see if the package has been previously installed. As such,
deleting your directory is just going to tell you that everything
hasn't been installed. The magic is in these lines of
/sbin/upgradepkg.

==========
# Test to see if both the old and new packages are where we expect them
# to be -- skip to the next package (or package pair) if anything's
wrong:

if [ ! -r $ROOT/var/log/packages/$OLD ]; then
if [ ! "$INSTALL_NEW" = "yes" ]; then
if [ "$DRY_RUN" = "true" ]; then
echo "$OLD would not be upgraded (no installed package named $SHORT)."
else
==========

As you can see, earlier in the script some variables were defined,
namely ROOT and OLD, and upgradepkg checks $ROOT/var/log/packages/$OLD
to see if a previous version was installed.

To the OP, the only way I now to discover what packages were installed
with any degree of certainty would be very manual, involving a script
that would check MANIFEST for the existance of that file, discover what
package it belongs to, and then put that list somewhere in /tmp. You
could then pass it as an argument to installpkg or something.

Optionally, you could just installpkg everything, them removepkg what
you don't want. It's really heavy-handed, but gaurantees not to rip,
run, or snag.

- --
It is better to hear the rebuke of the wise,
Than for a man to hear the song of fools.
Ecclesiastes 7:5
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFCpu2qzLTO1iU1uO4RAntrAJ9hAbsuwov/ik26Jeb7sszMlLWiUgCePeut
sJUA+QuiEeWEMDVMw2ufF/c=
=8VJZ
-----END PGP SIGNATURE-----
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 02-20-2008, 09:10 AM
Eef Hartman
 
Posts: n/a
Default Re: deleted /var/log/packages

No_One <no_one@no_where.com> wrote:
> Should contain most if not all the packages.


Most, indeed, not all packages have a corresponding script.
--
************************************************** ******************
** Eef Hartman, Delft University of Technology, dept. EWI/TW **
** e-mail: E.J.M.Hartman@math.tudelft.nl, fax: +31-15-278 7295 **
** snail-mail: P.O. Box 5031, 2600 GA Delft, The Netherlands **
************************************************** ******************
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15 (permalink)  
Old 02-20-2008, 09:10 AM
Eef Hartman
 
Posts: n/a
Default Re: deleted /var/log/packages

Lars Behrens <Spam.Buster@web.de> wrote:
> Me too. But honestly I simply didn't think of the packages branch, neither
> when setting up the backup nor when deleting the log directory.


You should NOT delete the "log" directory anyway, too many important files
(especially to guard against hackers) are there, like
wtmp (historical database of logins), lastlog (when was every user
last logged in) and faillog (last failed logins).
Furthermore the "setup" directory is a subdir of log so you also got
rid of all the setup scripts.
Cleaning UP logfiles is a much better habit, look for instance at
"logrotate".
--
************************************************** ******************
** Eef Hartman, Delft University of Technology, dept. EWI/TW **
** e-mail: E.J.M.Hartman@math.tudelft.nl, fax: +31-15-278 7295 **
** snail-mail: P.O. Box 5031, 2600 GA Delft, The Netherlands **
************************************************** ******************
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #16 (permalink)  
Old 02-20-2008, 09:10 AM
Loki Harfagr
 
Posts: n/a
Default Re: deleted /var/log/packages

Le Wed, 08 Jun 2005 13:08:51 +0000, +Alan Hicks+ a écrit*:

> In alt.os.linux.slackware, Loki Harfagr dared to utter,
>> A quick idea, if you have a slackware deposit or if you mount
>> the install cd, cd to the slackware/ dir and check like yhis :
>> # upgradepkg --dry-run ap/*.tgz |grep '(already installed).$' |cut -d' ' -f1
>>
>> would list the ap/ packages you installed.

>
> Did you actually try this?


No of course not, that's why I warned "A quick idea" !
I was on a hurry at work, then hadn't time to cripple an installation to
check if it worked ;-)
(yes, I know, a movedir'd be enough or a gentle look at
the upgradepkg script, like you did :-)

> It won't work. upgradepkg relies entirely
> on the existance of files inside /var/log/packages and does no other
> checking to see if the package has been previously installed.


You're right, sorry OP, it was just a "bad quick idea" based on the way I
did long ago a reconstruction of tagfiles in this way, but indeed my
/var/log/ was alive ...

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #17 (permalink)  
Old 02-20-2008, 09:10 AM
notbob
 
Posts: n/a
Default Re: deleted /var/log/packages

On 2005-06-08, usenet@isbd.co.uk <usenet@isbd.co.uk> wrote:

> ... and from then on you automatically hit 'y' every time you run one
> of these commands, in my experience these aliases are just a nuisance,


Only if you allow it to be. If you need to do a mass rm and don't
want to hit 'y' every time, a simple -f option will override the -i
optioned alias.

nb
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:50 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com