Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to find where someone has installed a software package, and I can not. Is there a good way of finding that other than running a grep on the entire file system?

I am running Ubuntu and looking for an installation of a triple-store database called Virtuoso.

Thanks, Alex

share|improve this question

5 Answers 5

up vote 1 down vote accepted

All the other answers given handle package installations. Without root level access there are few places a user can install software:

  • ~ (Their home directory)
  • /tmp (The temporary directory, package will likely disappear on next reboot.)
  • /var/tmp (Alternate temp directory. More likely to survive a reboot.)
  • /var/lock (Publicly writeable.)
  • Any other directories which they can write (none on a standard configuration).

Normal places to install packages not using the package manager include:

  • /usr/local
  • /var/local (variable components)
  • /opt

Commands to find writable directories (for user somebody in group users).

sudo find / -type d -perm -02
sudo find / -type d -perm -020 -group users
sudo find / -type d -perm -0200 -user somebody

The user may belong to multiple groups. Each group will need to be checked.

share|improve this answer
    
Combine this with my answer about using locate. –  Phil Hollenback Mar 24 '11 at 19:42
whereis Virtuoso

Or, if the binary is called something else:

whereis name-of-binary

Or, if the software isnt located in the usual places (/bin, /sbin, /usr/bin etc)

which name-of-binary
share|improve this answer

Was it installed using apt or dpkg? If so you can use dpkg -l |grep <name> to find the packages and dpkg -L <package name> to find where it installed the files.

If it was not installed using the package management system, look at /opt and /usr/local first, and if it fails, use find / -iname <what you are searching> to search the whole filesystem.

share|improve this answer

If you installed with apt or dkpg

dpkg -L virtuoso

will show you the location of all the files installed.

share|improve this answer

Don't forget the locate(1) command. If this is set up, updatedb runs nightly on your machine and creates an index of all files. Then for example

$ locate myprogram

will give you every file which contains myprogram (in the filename or path) on the system.

If you know the exact name of the binary, you can use a regexp match to find it, for example:

$ locate --regexp="myprogram$"

will list all files which end in myprogram on your system.

Two caveats:

  1. Many systems ship with updatedb turned off by default.
  2. The index is generally rebuilt once a day, so it will always be somewhat out-of-date.

locate can be a good way to get a sense of where on the system a particular file might be, before you drill down to looking for the package.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.