LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Identifying "non-native" Slackware-packages in /var/log/packages (http://www.linuxquestions.org/questions/slackware-14/identifying-non-native-slackware-packages-in-var-log-packages-461212/)

Yalla-One 07-05-2006 10:29 AM

Identifying "non-native" Slackware-packages in /var/log/packages
 
I would like every once in a while to get a list of all software installed on my system that is not a native part of Slackware (ie which packages came from Pat, and which came from various other slackbuilds?)

Anyone got a good command and/or script to do this?

-Y1

dennisk 07-05-2006 11:44 AM

What you should do is maintain a ChangeLog just as Patrick does, so you know what you installed, when you installed it and where it came from.

Dennisk

Yalla-One 07-05-2006 11:52 AM

Quote:

Originally Posted by dennisk
What you should do is maintain a ChangeLog just as Patrick does, so you know what you installed, when you installed it and where it came from.

Good call, except when a system is inherited and I'm trying to figure out what's done before, which is why I'm trying to make such a script ;)

-Y1

dugan 07-05-2006 12:27 PM

Have "ls" display the contents of /var/log/packages sorted by date. That won't tell you everything but it will give you a lot of hints.

Yalla-One 07-05-2006 01:21 PM

I'm almost there - hopefully this should be a significant step towards a functional solution:
Code:

ls -1 /var/log/packages >/tmp/installed_packages
cd /root/slackware
ls -1 */*.tgz | sed -e 's/.*\///' >/tmp/original_packages
diff /tmp/installed_packages /tmp/original_packages

Remaining problem:In addition to strip the preceeding directory name, I also need sed in the same turn to strip the trailing .tgz in order to make sure I compare apples to apples.

Any sed-gurus here who know how to edit my sed statement to make this happen?

-Y1

simcox1 07-05-2006 02:15 PM

There is an option in slackpkg to remove all software which doesn't belong to a standard install, although that doesn't seem to be what you're looking for.

Yalla-One 07-05-2006 02:32 PM

Here's the solution - a bit crude, but does exactly what I needed..

Code:

#!/bin/sh
OUT_INSTALLED=/tmp/slack-installed
OUT_ORIGINAL=/tmp/slack-original
INSTALLDIR=/root/slackware
VARLOG=/var/log/packages

if [ -f $OUT_INSTALLED ]; then
  rm -f $OUT_INSTALLED
fi
if [ -f $OUT_ORIGINAL ]; then
  rm -f $OUT_ORIGINAL
fi

cd $INSTALLDIR
ls -1 */*.tgz | sed -e 's/.*\///' -e 's/.tgz//' |sort > $OUT_ORIGINAL
cd $VARLOG
ls -1 | sort > $OUT_INSTALLED
cd /tmp
diff $OUT_ORIGINAL $OUT_INSTALLED


pdw_hu 07-06-2006 05:59 AM

Or if your lucky, usually the non-native packages have a name abbreviaton at the end (like all pkgs from linuxpackages.net). Or sometimes the lack of info (description) can be a starting point.

notlob 07-06-2006 06:57 AM

Quote:

Originally Posted by simcox1
There is an option in slackpkg to remove all software which doesn't belong to a standard install, although that doesn't seem to be what you're looking for.

"slackpkg clean-system" shows all installed non standard packages (apart from the packages listed in /etc/slackpkg/blacklist) before it asks to remove them.

Code:

root@slackbox:~# slackpkg clean-system

Looking for packages to remove. Please, wait...

amarok-1.3.9-i486-1
bonnie++-1.03a-i386-1
digikam-0.8.1-i486-1asz
freemind-0.8.0-noarch-1sdd
...
Total of package(s): 24

Do you wish to remove selected packages (Y/n)? n



All times are GMT -5. The time now is 05:38 PM.