I'm new to Ubuntu and would like to know where I can find the location of program files for programs installed from the Ubuntu Software Center or the Terminal.
8 Answers
Also, if you just need to know where the executable is you can run whereis executable
or which executable
For instance:
$ whereis firefox
firefox: /usr/bin/firefox /etc/firefox /usr/lib/firefox /usr/share/man/man1/firefox.1.gz
$ which firefox
/usr/bin/firefox
on the command line, you can use dpkg --listfiles packagename
. For instance, dpkg --listfiles firefox
. If you want to see what files a package contains without installing it, then you can install apt-file and use that.
But you really shouldn't mess with it. There is usually no reason to manually interfere with the contents of a package. All configuration files for normal applications are placed in the users home directory. You don't have savegames in C:\Programfiles\Appname\savegames
, for instance. They would be placed in /home/username/.local/share/appname/savegames
. That way, if you move your home directory to another machine, it keeps all configurations and user data.
-
This command says "package 'sdl' is not installed"; But this command: "dpkg --get-selections | grep sdl" returned : libsdl-image1.2:amd64 install ---- libsdl1.2debian:amd64 install ---- libsdl2-2.0-0:amd64 install ---- libsdl2-dev install– Dr.jackyCommented Dec 19, 2015 at 6:48
-
The OP wants to know where the installation directory containing the app files is located. He did not ask for a list of files in a package. Commented Nov 6, 2018 at 8:51
-
@HedleyFinger: There is no such thing as the "installation directory". Each app has files stored in many different directories for different types of files. /etc for default configs, /usr/bin for binaries, /usr/lib for libraries, etc. The command I showed, shows where all app files are installed. Commented Nov 7, 2018 at 16:51
If you do not find the command with whereis
or which
then maybe it is an alias. Try
alias
and check if the command is in the list.
Use the synaptic-package-manager
:
Assuming that we'd like to locate the files of the autotools-dev package, under 'Quick filter' enter autotools to locate it. The autotools-dev package appears automatically. Select it by clicking on it and then press 'Properties'. In the appearing dialog select the tab 'Installed Files'.
-
4
-
2I appreciate the screen shot and think this answer is a useful addition. It shouldn't be down voted. Commented Jan 16, 2017 at 21:58
The builtin Bash command, called command
is also available:
command [-pVv] command [arguments …]
Examples of usage:
$ command -v cat
/bin/cat
$ command -V cat
cat is /bin/cat
When the searched command is an alias:
$ command -v ll
alias ll='ls -alF'
$ command -V ll
ll is aliased to `ls -alF'
Coming to Linux from Windows, there are some different terminology, which sometimes seems strange.
The first one is the word package that we find on Linux. We install packages on Linux, which may sound different but makes total sense:
- When installing something on the computer, we are installing programs like in your question, but also configuration files, images, documentation, etc. Sometimes we are even installing, in one package, many programs
One example for you, i was looking for installing a package called bluez-tools in Lubuntu 22.04. In your terminal:
sudo apt install bluez-tools
After installing it, the question is, how to use this bluez-tools stuff i have installed. Then we have the answer to your question, we have to look for what and where we have just installed the package in our system.
The following command gives you some information about the package you just installed.
dpkg -l bluez-tools
ii bluez-tools 2.0~20170911.0.7cb788c-4 amd64 Set of tools to manage Bluetooth devices for linux
And this other command shows what and where things were installed
dpkg -l bluez-tools
/.
/usr/bin
/usr/bin/bt-adapter
/usr/bin/bt-agent
/usr/bin/bt-device
/usr/bin/bt-network
/usr/bin/bt-obex
/usr/share
/usr/share/doc
/usr/share/doc/bluez-tools
/usr/share/doc/bluez-tools/README
/usr/share/doc/bluez-tools/changelog.Debian.gz
/usr/share/doc/bluez-tools/copyright
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/bt-adapter.1.gz
/usr/share/man/man1/bt-agent.1.gz
/usr/share/man/man1/bt-device.1.gz
/usr/share/man/man1/bt-network.1.gz
/usr/share/man/man1/bt-obex.1.gz
It can be seen the package contains 5 programs, some docs, and five manual pages.