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.
Where is installed software stored in Linux? [duplicate]
I’m new to Linux and I want to ask a bit more about packages. In Windows, I download an .exe file and install it. When I install, I define the path where I want that application to be stored. In that folder, I have all the files required for the application. However, when I install a package in Linux using yum or apt-get , I don’t know where the package is installed to and where the required files for that application are stored. I have seen that most of the configurations are in the /etc directory. But why does Linux store the required files for an application in different directories? Can someone tell me how packages are installed, and where and how are they stored? And if my understanding about package management is wrong, please correct me.
If your distribution uses rpm , you can use rpm -q —whatprovides to find the package name for a particular file and then rpm -q -a to find out what files a package installed.
8 Answers 8
Many programs (the binaries/scripts) end up in /bin or /usr/bin with other parts in various configuration directories (often in/under etc ) as you already noted.
For any specific command you can checkout whereis
and it will give you some information about where this command is to be found. You can also try which
@KOU I don’t know the history of this, but it could be so that programs could be updated without messing up the configuration information since it would be in a different directory. This way different versions could use the same config information (assuming the format etc was not changed ie was compatible). I am just surmising here. You’d have to research the history of the Unix/Linux file system for a definite answer.
I’m not sure of the history of the decision to put all system-wide config files in /etc/ , but having one central location for config files makes it very easy to back them up. (Imagine backup up system-wide config files in Windows, where they’re scattered all through the filesystem and registry. )
You can get a list of the files that a given yum package installs by doing:
Then you can run it like so:
(Obviously, replace «yum-utils» in that second one with the name of that package whose file list you’d like to see.)
Under Windows, particularly older versions, it was common for programs to store configuration files and non-constant data in their C:\Program Files directory. This is derived from how programs were usually installed and ran under single-user, non-networked, non-file-permission DOS.
From a security standpoint, this is a bad idea. Places where executable code lives should be separated from modifiable data. That way it’s easier to apply appropriate file permissions to prevent modification of installed binaries by unauthorized users. Similarly library directories which may be updated separately from main executables should also be in a separate directory.
With the advent of Vista and UAC annoyances, this tradition is finally starting to seriously lose traction.
UNIX, and Linux, being a multiuser system from much earlier on, had the tendency to separate executable directories from other directories much earlier, since there was a need to prevent users other than root from modifying installed binaries. It’s also why /usr and even /sbin are sometimes separate partitions — a particularly security conscious admin can mount those partitions readonly and remount them read/write when an install/uninstall needs to happen.
Packages are usually installed from a package manager. There’s various package managers, such as aptitude (Debian and derived distributions), yum (Redhat and derived distributions), pacman (forget which distro this is. ), and others.
The package manager lets you browse repositories, download, install, query, and remove software, much like a sophisticated (and free) «app store.» It assumes responsibility for ensuring dependencies are taken care of and tracking what is currently installed.
Usually the package manager will also allow the same operations on a package you downloaded manually outside of any repositories. Tools are also available if you want to create your own from software you made or compiled yourself.
Since the package itself is NOT an executable file, you don’t have to run an untrusted executable which you don’t really know what it does. (Windows is finally coming around with updates by distributing .msu ‘s instead of .exe ‘s — but .msi ‘s have been around a while. )
Where is the default folder for Apps? [duplicate]
I am relatively new to the linux world. I use OSX at home and Windows at work. In those worlds, there is a default folder for applications ( C:\Program Files , /Applications ). Is there any such directory in Ubuntu? I understand that this is not very important and any location in the file system should be ok, but was just wondering whether there are such standard locations (I think there would be one). For instance where is Firefox or Libre Office (that are installed by default)? Got this question when I was trying to install eclipse. Downloaded the zip, and was wondering.
1 Answer 1
Ubuntu (Linux) follows the filesystem hierachy structure. There is a description of the main directories in that link.
The location where software gets installed depends on how you install it. If you use the most obvious method (Ubuntu Software Center/ .deb ‘s) it generally gets installed to the default locations. In that case libraries will end up in /usr/lib/ (Libraries for the binaries in /usr/bin/ and /usr/sbin/ .) and the executable in /bin (Essential command binaries that need to be available in single user mode; for all users, e.g., cat , ls , cp ), /usr/bin or /usr/sbin (Non-essential command binaries (not needed in single user mode); for all users).
Some other important directories are /opt and /usr/local/share .
/opt : Optional application software packages. Jasperserver (a stand-alone and embeddable reporting server) for instance installs into /opt .
/usr/local is for data that must be stored on the local host and is used for installing software/data that are not part of the standard operating system distribution. In this directory you will find lib for libraries en bin for executables.
You can use system settings , main menu to browse for executables. Or from command line with locate . Or inside Ubuntu Software Center you can browse all the files that are used for a package. Examples using locate and libreoffice :
locate libreoffice|grep bin
will show /usr/bin/libreoffice .
Sidenote: Eclipse is in the software center so no need to download a zip (unless you want the newest version and not the most stable one):