Best way to find programs not installed by a package manager
Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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]
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.
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
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.
.....
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 )
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.