Identifying "non-native" Slackware-packages in /var/log/packages
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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?
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.
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
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.