LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-16-2016, 01:09 AM   #1
rng
Senior Member
 
Registered: Aug 2011
Posts: 1,198

Rep: Reputation: 47
Find orphan library packages


I am trying to find orphan library packages. Following commands give all the libraries needed by all executables in /usr/bin folder:
Code:
$ cd /usr/bin
$ for FF in *; do ldd $FF;  done   | cut -d '=' -f 1  | cut -d '(' -f 1 | sort | uniq > ~/lddout.txt
This produces a list of about 1150 library files needed on my system.

For getting installed library files, I can run:
Code:
$ cd /usr/lib 
$ find -type f -printf "%f\n" | sort > ~/libout.txt
Is it possible to find orphan library packages (i.e. those packages which are not needed by any other package) by comparing (using diff command) the lddout.txt and libout.txt files? Thanks for your help.

Last edited by rng; 02-16-2016 at 01:14 AM.
 
Old 02-16-2016, 02:08 AM   #2
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: SlackWare > Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy .. bullseye bookworm
Posts: 1,834

Rep: Reputation: 108Reputation: 108
Hya,

I somewhat think that not all executable sit in /usr/bin.
I also think that not all libraries sit under /usr/lib.

cheers

PS. I do not think that your second query works as you expect.
Quote:
$ cd /usr/lib
$ find -type f -printf "%f\n" | sort > ~/libout.txt

Last edited by kaz2100; 02-16-2016 at 02:14 AM.
 
Old 02-16-2016, 05:30 AM   #3
rng
Senior Member
 
Registered: Aug 2011
Posts: 1,198

Original Poster
Rep: Reputation: 47
What is the alternative? How can I find orphan packages using bash commands?
 
Old 02-16-2016, 07:17 AM   #4
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by rng View Post
What is the alternative? How can I find orphan packages using bash commands?
What OS? Architecture? Release point?
The ubu flavors have deborphan in popular repos.

We don't want one of these.
 
Old 02-16-2016, 11:03 AM   #5
rng
Senior Member
 
Registered: Aug 2011
Posts: 1,198

Original Poster
Rep: Reputation: 47
Quote:
What OS? Architecture? Release point?
Can there be a method using bash commands and tools which can be applied to any distribution?
 
Old 02-16-2016, 11:24 AM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by rng View Post
Can there be a method using bash commands and tools which can be applied to any distribution?
Probably not a reliable one.
 
Old 02-16-2016, 06:22 PM   #7
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: SlackWare > Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy .. bullseye bookworm
Posts: 1,834

Rep: Reputation: 108Reputation: 108
Hya,

It looks like that OP's original scripts are designed to find orphan libraries.
Many library packages contain more than one library.

OP need to find how to trace to a library package from an individual library.

cheers
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
unresolved/orphan packages digging johnpuppa Slackware 11 09-25-2014 07:22 AM
[SOLVED] About Arch orphan packages Mr. Alex Arch 5 04-13-2012 01:33 PM
remove unused / orphan packages keratos Linux - Software 5 09-04-2008 01:01 PM
is there a way to remove orphan packages? keratos Mandriva 5 06-20-2007 02:43 AM
orphan packages and libraries alexrait1 Slackware 1 07-05-2004 06:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:56 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