LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Get list of packages not in base system (https://www.linuxquestions.org/questions/slackware-14/get-list-of-packages-not-in-base-system-842026/)

abesirovic1 11-02-2010 09:40 PM

Get list of packages not in base system
 
Hey all,

Is it possible to get a list of packages installed on the system that are not a part of Slackware (i.e. take all installed on system, take all packages that originally come with slack, find difference)?

Worthy to mention is that I use slackpkg and run -current.

Thanks lots.

allend 11-02-2010 09:44 PM

You can use 'slackpkg clean-system' to show you the packages installed that are not part of the official Slackware tree.

abesirovic1 11-02-2010 09:46 PM

From slackpkg manpage:
Quote:

clean-system
This action removes all of the packages that don't belong to a standard Slackware installation. With this option, you can clean up your system,
removing third-party packages as well as any packages that were removed from the official Slackware package set.
If you have some third party (or custom built) packages that you would like to keep, you can temporarily add them to the list of blacklisted packages
before you run the 'clean-system' action.
I don't want to remove any packages nor a clean install, just to see packages I have installed by hand.

allend 11-02-2010 09:59 PM

No packages will be deleted unless you say to do so. You can still scroll through the list and when done just select cancel.

dc_eros 11-02-2010 10:25 PM

I do slackpkg clean-system to see the third party packages installed on my Slack. However, I found it hard to dump the list into a text file. I resorted to running it, then cancel. Copy and paste to a text file then repeat again scrolling down for the next line until all packages are copied to text file.

With 78+ packages currently I have, is there a better way of dumping those list somewhere. I cannot see such option on the man page.

brixtoncalling 11-02-2010 11:59 PM

Use slackpkg
Code:

$ generate-template installed
This will give you a list of installed official Slackware packages in /etc/slackpkg/templates/installed. But you'd still have to do some cutting and grepping and diffing to compare with the output of
Code:

$ ls /var/log/packages

ponce 11-03-2010 01:05 AM

as external packages usually come with custom tags, to see them you can also filter the standard ones out with a regexp
Code:

ls -1 /var/log/packages/ | grep -v '\-[0-9]\{1,2\}$'
on my laptop (running 64-current)
Code:

# ls -1 /var/log/packages/ | grep -v '\-[0-9]\{1,2\}$' | wc -l
653

\o/

T3slider 11-03-2010 02:00 AM

I'm not sure if this still works (I checked it in a previous release...either 12.2 or 13.0 and it still did), but I recall this thread, which mentions this:
Code:

slackpkg -dialog=off -batch=on -default_answer=no clean-system > NonSlackwarePackages.txt
There is also this thread for those who do not wish to use slackpkg.

ponce 11-03-2010 02:03 AM

thanks for the links, very interesting threads :)
I'll dive into them.

dc_eros 11-03-2010 02:51 AM

T3slider: That works!

Thanks

allend 11-03-2010 02:51 AM

Just to show another way to skin the cat.
This script uses the PACKAGES.TXT file that slackpkg creates.
It will also show packages that are blacklisted in /etc/slackpkg/blacklist
Code:

#!/bin/bash

# Script to list non-official installed packages
# Official packages are referenced from PACKAGES.TXT created by slackpkg
# Installed packages are referenced from contents of /var/log/packages/

for PKG in /var/log/packages/* ; do
  if ! grep -q ${PKG##/var/log/packages/} /var/lib/slackpkg/PACKAGES.TXT ; then
    echo ${PKG##/var/log/packages/}
  fi
done



All times are GMT -5. The time now is 11:37 AM.