1

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

Genadinik
  • 1,083
  • 4
  • 18
  • 38

5 Answers5

4
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
pauska
  • 19,532
  • 4
  • 55
  • 75
3

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.

coredump
  • 12,573
  • 2
  • 34
  • 53
2

If you installed with apt or dkpg

dpkg -L virtuoso

will show you the location of all the files installed.

sreimer
  • 2,168
  • 14
  • 17
2

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.

Phil Hollenback
  • 14,647
  • 4
  • 34
  • 51
1

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.

BillThor
  • 27,354
  • 3
  • 35
  • 69