Where can I find the location of folders for installed programs?
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.
If you prefer/use RPM on Ubuntu, you can also use rpm –ql [package] to get a list. This method also happens to work on most Fedora and RHEL distros.
8 Answers 8
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
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.
@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.
If you do not find the command with whereis or which then maybe it is an alias. Try
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’.
The builtin Bash command, called command is also available:
command [-pVv] command [arguments …]
$ 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.
Find installation path in linux [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
services are automatically installed. How to find exact path where any service is installed and their configuration files??
3 Answers 3
There are quite a few ways to find this but I usually prefer following
and to find from which path program is using, I use
If you’re using apt-get , install apt-file program and you can list the contents of the package:
sudo apt-file update apt-file list package_name
This will show all the files that will be installed by a package, binaries, configuration files, systemd startup files, etc.
If you use yum , install yum-utils and use repoquery :
Suppose service name is nginx then you can find it in /etc/nginx/ on ubuntu .
On centos you can check path using commands given by slashRahul. As per my knowledge you can not change installation path while installing by apt-get. Software components are not installed in a single directory, but across many folders like binaries stay in /usr/bin/, /bin, /sbin, Configuration in other directories.
How can i find the location of installed software in linux?
Is there any command that I can use in the console to know the location of installed software in linux? i have copied a xyz.bin from windows machine to linuxdesktop and installed it. more over can you please tell me how to uninstall a software which is installed in linux Thanks in advance
You might be able to use the find command to search for it. Have a look at this unix.stackexchange.com/questions/19369/…
3 Answers 3
to find the path where the binary is linked to.
Other application specific files may reside in
The way a package is installed/uninstalled on Linux depends on either the specific Linux distribution AND the specific package.
Since you have used a .bin file for installation, it is likely that you have an uninstall command specific for your program in the path.
If you provide more information about the package and the Linux distribution, we can give more help.
It depends on the distribution you’re using. Supposing you are using a debian\ubuntu distribution, you can uninstall it by the apt command, using sudo apt-get remove software_name sudo apt-get purge software_name
Of course you need to have root privileges.
The softwares are usually installed in bin folders, in /usr/bin, /home/user/bin and many other places, a nice starting point could be the find command to find the executable name, but it’s usually not a single folder. The software could have components and dependencies in lib,bin and other folders.
Into which directory should I install programs in Linux?
I want to install a program in Linux and run it as a daemon. (Team Speak 3 in this case, but the question is general in nature). There is no package provided, only tarred binaries. Where in the directory structure should I put such a program by convention? On the web I found that /opt is for «optional addon apps», while /usr is for «user programs». I found one tutorial suggesting /opt while another suggested /usr . So which one is «more correct»?
The «more correct» depends on your distribution. You should check your distribution’s guidelines on where to put software that isn’t managed by the package manager (often /usr/local ) OR on how to create your own package for it.
Thank you Leiaz. Your comment helped me to find the answer (askubuntu.com/questions/1148/…). So I guess it should be /opt in my case (Using Linux Mint, which is based on Ubuntu) and the application is using a single folder. If you convert your comment into an answer, I will accept it.
The convention is bad. Ignore the convention. Make ~/apps or ~/programs and put your programs in there. Make ~/apps/binaries or ~/apps/on-path , add that to your $PATH env var, and symlink the programs you want into binaries .
@iono Convention is good when you’re installing a package that will be used by more than one person. Installation in /usr/local is globally accessible, installation in ~onealdw/apps cannot be accessed by any user other than myself.
Yes, I was asking here about a program, which would run as a service (daemon) (even when all human users are logged off), not a personal app that some user would run from their home directory.
8 Answers 8
The «more correct» depends on your distribution. You should check your distribution’s guidelines on where to put software that isn’t managed by the package manager (often /usr/local ) OR on how to create your own package for it.
As you said, TeamSpeak just put everything in one folder (and may not be easy to reorganise), yes /opt/ is probably best.
(But, for instance, in Arch Linux, the package manager can install there, so I’d still make a PKGBUILD to install in /opt .)
Also distributions usually try to follow the Filesystem Hierarchy Standard, so this is where to look for more generic conventions.
is there some alias to know where are located each directory by usage? (for example, where to put root configurations, where to put binaries, dependencies, templates. )
Usually you put your downloaded folder in /opt and create a symbolik link from /usr/bin. If the app has a GUI a very useful thing to do is to create a NAME.desktop file in /home/USER/.local/share/applications such that you will see it from the main menu. unix.stackexchange.com/a/103222/130710
If you will be compiling your own software then you ultimately control the installation location. By convention, software compiled and installed manually (not through a package manager, e.g apt, yum, pacman) is installed in /usr/local . Some packages (programs) will create a sub-directory within /usr/local to store all of their relevant files in, such as /usr/local/openssl . Other packages will install their necessary files into existing directories such as /usr/local/sbin and /usr/local/etc . These are simply default locations and can be changed during compilation.
When you are compiling software, the installation location can be specified by using the —prefix= option when running ./configure . It is highly recommended that you look at all of the available options for your package by running $ ./configure —help | less . Additionally, browsing the INSTALL and README documents provided with your package is a good idea. They tend to include installation instructions and dependency information that is specific to the package.
It should also be noted that although you can store software anywhere, according to the FHS, source code for locally installed software should be stored in /usr/local/src Standardizing where you store your source trees will allow you to easily locate a tree if you need to copy a stock configuration file or binary. Even though some packages use it, your source code should not be stored in /usr/src as that is designated for system software such as the kernel.
Finally, you need to ensure that your installation location is included in your $PATH . If you decide to install your package in /opt but it’s not in your $PATH your shell won’t find the executables and you will have to use the absolute path to invoke your programs. Here are some great discussions from AU about configuring your $PATH
Additional reading: man hier