LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-18-2010, 04:19 PM   #1
pobman
Member
 
Registered: Jun 2005
Location: Wellington, New Zealand
Distribution: Fedora 9
Posts: 31

Rep: Reputation: 16
Best way to find programs not installed by a package manager


Hi peeps,

I am trying to think of the best way to find packages that have been installed by NOT using a package manager.

To find installed packages one would search rpm or pkg DB, but what if the software was installed by a tarball or bin or even compilled.

Anyone got any suggestions on how to script for these, I was hopeing to write a script to find all the third party stuff, I iknow there will be a lot of stuff that gets picked up so what is the best way to get minimise false positves?

Any ideas welcome.
 
Old 02-18-2010, 05:23 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
The real problem lies in "third party stuff" (which is kind of vague a definition), what the FSSTND / FHS / LSB suggests one should do and how a system is actually managed ("let's dump everything in /srv anyway"). For RH.*L and derivatives a 'find /path/ -type f -print0|xargs -0 -iX rpm -qf 'X' |awk '/not owned/ {print $2}';' could be a start, AFAIK that's 'dpkg -S' for Debian and derivatives. Systems where package management can't even list package contents will obviously s*ck major as you will have no basis to work from whatsoever.
 
Old 02-18-2010, 05:26 PM   #3
CoderMan
Member
 
Registered: Jan 2009
Location: Gemini Capsule 25164
Distribution: Gentoo
Posts: 375
Blog Entries: 24

Rep: Reputation: 43
Well, you can install slocate. With slocate, after installation you can run "updatedb", and then "locate <application name>".
 
0 members found this post helpful.
Old 02-18-2010, 05:26 PM   #4
mattca
Member
 
Registered: Jan 2009
Distribution: Slackware 14.1
Posts: 333

Rep: Reputation: 56
I think if the software wasn't installed via some utility you have to keep track of it yourself. That's part of why people use package managers.

You could just look in your bin dirs and see what's there. Maybe grep -v it against output from your package manager to just see what wasn't installed via the manager.

[Edit: Also, yeah if you just want to find out if a certain package is installed (as opposed to getting a list of all packages that were installed without a manager) locate should do the trick]

Last edited by mattca; 02-18-2010 at 05:28 PM.
 
Old 02-18-2010, 05:35 PM   #5
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Slackware has
Quote:
src2pkg
which will create a package from the source file.
Then you can use the packagemanager to install.
Don't know for other distro's though
 
Old 02-18-2010, 08:50 PM   #6
pobman
Member
 
Registered: Jun 2005
Location: Wellington, New Zealand
Distribution: Fedora 9
Posts: 31

Original Poster
Rep: Reputation: 16
I know slocate and find quite well, and guessed I hoped for a solution that I may have overlooked.

The problem is I managee several linux servers, and wanted to be able to proivde lists of all the installed software, rpm -qa etc works well for software installed via an RPM but for those odd little besoke packages that some company 10 years ago provided a gz or even zip installer for gets left out, I hope most packages are instlled in the opt dir but you can never be sure.

I could check for files in /bin /sbin etc... and then find what proveds etc but it would take some time to run.
 
Old 02-19-2010, 04:07 AM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
For new "packages", suggest : use a tool like checkinstall
to create an rpm package.

For all programs available as an SRC RPM source, use rpmbuild.
That would be the most common 15,000 to 20,000 programs.
Or write your own spec file to be used by rpmbuild.
.....
 
Old 02-19-2010, 05:41 AM   #8
cantab
Member
 
Registered: Oct 2009
Location: England
Distribution: Kubuntu, Ubuntu, Debian, Proxmox.
Posts: 553

Rep: Reputation: 115Reputation: 115
In general, I guess best way is to make the package manager spit out a list of what it installed, compare that to a directory listing, and show what is in the latter but not the former.
You could do it for the obvious places (namely, the directories in root's $PATH ), or do it for everywhere. (Well, all of /bin, /lib, /sbin, /usr, /var, and /opt )
 
Old 02-19-2010, 06:21 AM   #9
JimBrewster
Member
 
Registered: Feb 2010
Location: usa:/dev/random
Distribution: Slackware-15.0; -current
Posts: 245

Rep: Reputation: 60
Depending on how may packages you are dealing with, you could go back to a build tree and see where "make install" puts things.

I think this is why hand-compiled and installed packages usually default to /usr/local.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
applications appearing in package manager as installed but not starting... Siljrath Linux - Newbie 1 12-03-2009 01:35 PM
Programs installed with package manager aren't recognised by other programs fraserm Linux - Software 3 04-21-2007 12:38 PM
RPM package manager says package needs to be installed. But I already installed it! nick623 Linux - Software 2 05-24-2005 02:15 AM
cant find installed programs Skankin Pickle Linux - Newbie 5 08-30-2004 11:59 AM
Can't find where my programs are been installed to??? Stevetgn Linux - Newbie 4 02-06-2004 05:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:01 PM.

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