How to find installation directory for a certain program?
Assume someone installed a program somewhere in the past in a possibly non-default program directory.
Even worse: several other versions of the same program might exist (in different directories) on the local computer as well. So when I type at the terminal: myfoobarprog one of these programs is called. How do I find out the installation directory of the program with the highest priority (among the duplicates)? Is there a command like: showinstallationpath -prog=myfoobarprog |
which myfoobarprog
|
to find the installer package (at least on rpm based distro)
rpm -qf $( which myfoobarprog ) |
You can list the contents of a .deb with:
$ dpkg -c package.deb You can extract to a subdirectory with: $ dpkg -x package.deb ./path/ You can use strings on the executable to discover any special paths. Which you might also need to run on anything that it loads. $ strings $(which myfoobarprog) $ strace myfoobarprog | grep -i open Although the only way to "know" where it got installed is to have the thing that was installed in a state that it was when it was installed. Some of them even make it easy with an install.log and config.log. Although many are more primitive and need closer inspection. If you know "when" it was installed, you can sometimes use find to locate the files with similar timestamps. But that's more of a I don't have any clue, throw me a bone method. |
Quote:
Then reinstall the OS ( who knows what other TIME BOMBS EXIST!!!) that should NEVER happen now two or more different versions of software CAN be installed BUT precautions need to be taken ( or build the code to be installed SIDE by SIDE like gcc) |
As above, this
Code:
which myfoobarprog To find them all, Code:
find / -name myfoobarprog -type f |
There's also the command whereis.
|
Quote:
Code:
which -a myfoobarprog |
Quote:
Quote:
Code:
find / -name myfoobarprog -type d |
Quote:
|
All times are GMT -5. The time now is 02:43 AM. |