LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 01-03-2013, 07:17 AM   #1
FeyFre
Member
 
Registered: Jun 2010
Location: Ukraine, Vinnitsa
Distribution: Slackware
Posts: 351

Rep: Reputation: 30
Tool/script to gather info about installed files in system.


Hi

I need tool which list me files installed using Slackware native package manager.

Of course I can run
removepkg -warn /var/log/packages/* >/tmp/files
but it will work approximately infinitely.
Is there any existing one?
 
Old 01-03-2013, 07:22 AM   #2
vulcan59
Member
 
Registered: Sep 2007
Location: UK
Distribution: Slackware 14.2 & Current
Posts: 96

Rep: Reputation: 30
pkgtool has an option to view files contained in a package. Otherwise just list the contents of the files in /var/log/packages.

Last edited by vulcan59; 01-03-2013 at 07:24 AM.
 
Old 01-03-2013, 08:02 AM   #3
FeyFre
Member
 
Registered: Jun 2010
Location: Ukraine, Vinnitsa
Distribution: Slackware
Posts: 351

Original Poster
Rep: Reputation: 30
@vulcan59
1. pkgtool show content of ONE package, I need content of ALL packages.
2. It shows full content of file(s) in /var/log/packages, I need only file list only, w/o headers.
> Otherwise just list the contents of the files in /var/log/packages
As I already said, those files contain not only file list but package metadata also. I need file list only, excluding "./".
 
Old 01-03-2013, 08:29 AM   #4
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
You can get a sorted overview of all files mentioned in /var/log/packages using this command:
Code:
(for III in `ls /var/log/packages` ; do sed '1,/^.\//d' /var/log/packages/$III ; done ) | sort
But remember, the files in /install are not copied into the computer's filesystem, they are used by pkgtools. Also several packages have a "incoming" directory or *.new files which are handled by a doinst.sh script so that the files will end up in different locations of your filesystem than you might think if you look at the package content.

Basically you need to tell us why you want this before we can give you a useful answer. Also, you might put your brain to work and come up with a command yourself which does what you want.

Eric
 
Old 01-03-2013, 08:38 AM   #5
NonNonBa
Member
 
Registered: Aug 2010
Distribution: Slackware
Posts: 192

Rep: Reputation: Disabled
Hello,

This should do what you barely want:

Code:
awk '(f != FILENAME){pr=0;f=FILENAME}($0 =="./"){pr++;next}(pr>0){print}' /var/log/packages/*
And this variant ensures each file is printed only once:

Code:
awk '(f != FILENAME){pr=0;f=FILENAME}($0 =="./"){pr++;next}(pr>0 && !($0 in OK)){print;OK[$0]}' /var/log/packages/*
EDIT Oops... too late.

Last edited by NonNonBa; 01-03-2013 at 08:39 AM.
 
Old 01-03-2013, 10:41 AM   #6
FeyFre
Member
 
Registered: Jun 2010
Location: Ukraine, Vinnitsa
Distribution: Slackware
Posts: 351

Original Poster
Rep: Reputation: 30
@Alien Bob
> But remember
I do remember all of /install, .new and incomming

> Basically you need to tell us why you want this before we can give you a useful answer.
Because my FS has a lot of garbage. I.e. packages installed not using pkgtool and some very stupid software which does not cares anything. Then I shall compare this list with content of my FS and annihilate garbage.

> Also, you might put your brain to work and come up with a command yourself which does what you want.
I have already wrote C program which creates such list. Can share. But I wonder if there is any existing tool(as I explicitly wrote in first message).
 
Old 01-03-2013, 02:10 PM   #7
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
slackpkg has a "clean" option that will list all non stock Slackware packages. You could compare that list with the contents of /var/log/packages. Yet that option will not disclose all software that was installed. That option will only disclose which non stock Slackware packages have been installed. Using the "clean" option presumes having used the package manager.

Discovering software that was installed without using the package manager is challenging. For this same reason, recently I posted a query about a build script to wrap around the virtualbox run scripts. The point is not so much the dependability or trustworthiness of non package install scripts, but that knowing what was installed becomes a mess.

Possibly a script could query the contents of all bin directories and then grep /var/log/packages for those files. The difference would provide some clue about what was installed without the package manager. Unfortunately, some packages don't install bin files, such as perl add-ons.

Or a script that listed all files on a system and compared that list to the contents of all /var/log/packagges files. The difference would provide some clue of what was installed without the package manager.

Another possible option would be to install a stock Slackware system in a second real or virtual machine and then compare the contents of the two systems.

Currently there is no native Slackware tool or script to perform this task.
 
Old 01-03-2013, 05:34 PM   #8
FeyFre
Member
 
Registered: Jun 2010
Location: Ukraine, Vinnitsa
Distribution: Slackware
Posts: 351

Original Poster
Rep: Reputation: 30
Quote:
Or a script that listed all files on a system and compared that list to the contents of all /var/log/packagges files. The difference would provide some clue of what was installed without the package manager.
That is exactly what I doing now. I have result of "find /"(about 70MiB file list) and result of tool I seeking here(around 12MiB file list). Filtered both(or rather latest one) of well know garbage containers(/tmp,/var/log,/var/tmp,/root,/home,/var/cache etc) and doing "diff -u3" against them. As result I have .diff file every line insertion(+) of which show me not-controlled filesystem entries - my goal.
 
Old 01-04-2013, 03:02 AM   #9
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557

Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
Quote:
Originally Posted by FeyFre View Post
> Basically you need to tell us why you want this before we can give you a useful answer.
Because my FS has a lot of garbage. I.e. packages installed not using pkgtool and some very stupid software which does not cares anything. Then I shall compare this list with content of my FS and annihilate garbage.

> Also, you might put your brain to work and come up with a command yourself which does what you want.
I have already wrote C program which creates such list. Can share. But I wonder if there is any existing tool(as I explicitly wrote in first message).
Well if you used a tracking tool (like slacktrack, paco, src2pkg, etc.) whenever you install non Slackware packages it would be fairly easy.
 
Old 01-04-2013, 03:43 AM   #10
FeyFre
Member
 
Registered: Jun 2010
Location: Ukraine, Vinnitsa
Distribution: Slackware
Posts: 351

Original Poster
Rep: Reputation: 30
@ruario, I already asked somewhere here about tracking tool. Unfortunately none of proposed solutions works for my cases.
And second, tracking tool probably suitable solution when installing software, but it is impossible to use it when software runs and leaves garbage.
 
  


Reply

Tags
list, removepkg, slackware



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
How to gather all file system information jackiebaron Linux - General 4 09-04-2012 07:49 AM
Perl script to capture system info? Zmyrgel Programming 4 04-18-2009 03:30 AM
Info files in the help system, e.g., grub pwabrahams Linux - Software 3 01-10-2008 07:33 AM
tool to gather network information paul_mat Linux - Networking 3 01-18-2006 05:01 AM
Gather all files in one partition/folder iskrem Linux - General 5 11-27-2004 06:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:16 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration