LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Slack: script to detect orphaned libraries, broken lib links, missing dependencies (https://www.linuxquestions.org/questions/slackware-14/slack-script-to-detect-orphaned-libraries-broken-lib-links-missing-dependencies-794133/)

GrapefruiTgirl 03-10-2010 03:54 PM

New updated version! Wednesday Mar 10 18:00hrs AST or so (GMT -04:00) 2010

Now accepts the 'ridiculous' option, does (more) actual "missing dependency scanning", has better output formatting, and the visual display is fixed to those paths/files that were confusing us are no longer printed to the screen during execution.

mlangdn 03-11-2010 03:23 AM

Very nice Sasha! I got a couple of missing libs it seems. No biggie since i don't need them at the moment.

samac 03-11-2010 04:06 AM

Sasha many thanks this is a great diagnostic tool. I have a few suggestions which are purely cosmetic I hope you will adopt them.

1) Version numbering, so we can see if need to install an updated version.
2) /bin/bash as the default shebang, I would reckon 99% of Slackware users just use Bash
3) echo "This is going to take a while ....." after "round 3" just to let people know.
4) cat orphans.log to screen by default so that you can see some results.

As you can see nothing too dramatic, but I think they would add to your fine work.

samac

P.S. If I am reading orphans.log correctly my system is as clean as a whistle.

linus72 03-11-2010 04:25 AM

Yep Many Thanks girlie!

Code:

root@slackware:~/Downloads# chmod +x orphans.txt
root@slackware:~/Downloads# ./orphans.txt
## Slackware check for orphaned/missing libraries: Thu Mar 11 05:20:48 EST 2010
## Count installed packages: 831
## Round 1 -- Quick check for missing libs (via broken symlinks)...
# Done!           
## Round 2 -- Checking for orphan libs (not belonging to an installed package)...
# Done!           
## Round 3 -- Checking for missing dependencies (req'd by installed libs/binaries)...
# Done!             
root@slackware:~/Downloads#

Guess I'm good to go....

repo 03-11-2010 04:57 AM

Quote:

Guess I'm good to go....
did you checked the logfile in the current directory?

linus72 03-11-2010 05:10 AM

OH
Mmmmm...seems I am missing stuff heh?!

Code:

## Slackware check for orphaned/missing libraries: Thu Mar 11 05:20:48 EST 2010

## Count installed packages: 831

## Round 1 -- Quick check for missing libs (via broken symlinks)...

# Done!
## Round 2 -- Checking for orphan libs (not belonging to an installed package)...
## Evaluating objects in: /usr/i486-slackware-linux/lib
## Evaluating objects in: /usr/lib/firefox-3.6
## Evaluating objects in: /usr/lib/seamonkey
## Evaluating objects in: /usr/local/lib
# Done!
## Round 3 -- Checking for missing dependencies (req'd by installed libs/binaries)...
## Evaluating objects in: /usr/local/sbin
## Evaluating objects in: /usr/sbin
## Evaluating objects in: /sbin
## Evaluating objects in: /usr/local/bin
## Evaluating objects in: /usr/bin
3: Missing dependencies for: /usr/bin/audacious-arts-helper
3:> Missing: libartsc.so.0
3: Missing dependencies for: /usr/bin/kde4-window-decorator
3:> Missing: libkdecorations.so.4
3:> Missing: libkdecore.so.5
3:> Missing: libkdeui.so.5
3:> Missing: libplasma.so.3
3: Missing dependencies for: /usr/bin/oprof_start
3:> Missing: libqt-mt.so.3

## Evaluating objects in: /bin
## Evaluating objects in: /usr/games
## Evaluating objects in: /usr/lib/qt/bin
# Done!

I dont have any KDE stuff?

How does one find out Where to get missing libs???

Thanks Repo!

Lufbery 03-11-2010 07:59 AM

Excellent work, Sasha!

GrapefruiTgirl 03-11-2010 10:49 AM

Hiya folks!

I'm using Links at the moment, so no fancy quoting & replying in sequence at the moment for me.

Thanks for the suggestions above -- I have a couple more improvements of my own planned as well, and I will consider those suggestions above :) -- though the automatic version detection (if I read that right) pretty much implies having the thing hosted somewhere ( I guess) so that it can check *somewhere* for what version is current?

Sorry if I misinterpreted that -- again, trying to read & reply coherently using Links, is a task this time of day.

FWIW, since my borked install (wherein I ended up deleting all my lib dirs to fix it) and since the last update to my script here, I have been using the script on my machine -- and WOW, it turned up a lot of fscked stuff (to be expected) but it also made it REALLY easy to figure out what had to be fixed. Between this script, and slackpkg `search` function, I now have my machine spic and span, no dangling ends!

Unfortunately, despite all else being perfect, I STILL am unable to run the new Xorg in -current. At this point, it beats the heck out of me what the problem is.

Well, enough of my rambling! Looks like I gotta downgrade my X again ( AGAIN!!! :mad: ) so I can log in here properly and get my morning LQ fix.

Cheers folks! More suggestions welcome, I appreciate the feedback.

Sasha

vdemuth 03-11-2010 11:32 AM

Great work, but here is a suggestion for maybe a few iterations time. How about if the script could move the orphaned files to say a quarantine directory which would make it easier to remove them if they are definitely not needed.

GrapefruiTgirl 03-11-2010 12:01 PM

Hi vdemuth, thanks for that suggestion!

While I will keep it in mind (and had already considered something along these lines with the $SIMULATION variable actually determining the action) it is not likely that I will soon add any functionality that does anything 'automatically' along the lines of moving files around on teh users' system. The reason is that, maybe they have stuff installed that they know full-well is not included in a package, and quarantining it for removal would be definitely bad.

I believe for the forseeable future, the intent of my script will be to only _provide info_ to the user; what they choose to do with the info, is up to them.

As an example of what you are getting at, here's what I did on my machine this morning, to clean out binaries that belonged to packages I did not have installed:

shell$ cat orphans.log | grep "3: Missing" | xargs rm

which accomplishes basically the same idea that would be accomplished if the script were to move/remove the items itself.

SO, I think it's best to leave the final action to the user (more Slackware-like this way, and I think we like it like that).
Of course, suggestions further on this subject, and any other, are welcome.

Sasha

w1k0 03-11-2010 12:33 PM

@linus72

I tried that script in Slackware32 13.0 and it reported the same missing libraries:

Code:

3: Missing dependencies for: /usr/bin/audacious-arts-helper
3:> Missing: libartsc.so.0
3: Missing dependencies for: /usr/bin/oprof_start
3:> Missing: libqt-mt.so.3

I did full installation of Slackware so I suppose these omissions are typical for version 13.0.

On the other hand I learned about oprofile package and I started to wonder how I can use it for my purposes.

***

I tried that search engine http://slak.homelinux.org/pkgs/ and I discovered these libraries are from packages arts and qt from Slackware 12.2.

rusyd 03-12-2010 05:48 AM

this script only search for orphaned libraries in directories listed in /etc/ld.so.conf
is it possible orphaned libraries exist in other directories?

GrapefruiTgirl 03-12-2010 05:58 AM

Definitely possible. If you pass the 'ridiculous' option to the version you have, it will search more places.

But, you should wait, because in about 15 minutes or so (barring any really bizarre occurrences) there will be "Version 1.04" posted here, which has some added code to search for both orphaned libs AND binaries, in every locatable lib and bin directory on the machine. I'm just giving it a final test-run here, after which I will post it.

Sasha

GrapefruiTgirl 03-12-2010 06:22 AM

New version: 1.04

Updated: Fri Mar 12 12:29:50 UTC 2010

rusyd 03-12-2010 06:55 AM

i read the first version of your script and didnt find that option
i just downloaded the latest version
thanks, it's great work


All times are GMT -5. The time now is 04:57 PM.