2

When we download a binary Debian program from repository by this command:

sudo apt-get install something

Where is this program store and all of executable files?

Braiam
  • 67,791
  • 32
  • 179
  • 269
Mohammad Reza Rezwani
  • 10,286
  • 36
  • 92
  • 128

4 Answers4

3

In principle, a debian installer is nothing but a scaled model of your system, from the perspective of the root directory. It contains folders, exactly as it is on your system and "projects" the contents of a .deb file on to your system.

There are general rules of where to install what, for example: binary files in /usr/bin/ , libraries in /usr/bin or /usr/share, desktop file in /usr/share/applications and so on (see also here). If you are interested, you should look into a .deb installer to see what it installs where.

Jacob Vlijm
  • 83,767
1

Not all packages install exactly the same way, but some generalizations can be made and are usually adhered to.

Binary files that are called when you run the program are stored in /usr/bin or /bin.

You can check this by running <package> and /usr/bin/<package> with the same results.

Configuration files for the package are usually stored in /etc/<package>.

Here is a good breakdown of the filesystem

Dan
  • 6,753
  • 5
  • 26
  • 43
  • Ah, apologies, you submitted your answer just before I submitted mine. I completely forgot to mention /bin as well as a filesystem breakdown. – darthlukan Mar 27 '14 at 20:49
1

The really short answer is "It varies by package".

Here's the longer version:

These are the directories where most user programs are installed:

/usr/bin
/usr/local/bin
/opt

In general, if you've installed a package with sudo apt-get install <package>, the executable will usually be placed in one of those three directories. When I say "executable", I mean the file that is usually the name of the program that you "execute" from the command line.

Example:

`echo "foo"`

In the above example, there is a file named "echo" residing on your system that executes the program "echo".

If I understand your question correctly, you'd also like to know where the downloaded package archive is stored. That is very well answered at this link. I've included the "short version" below just in case the link does not resolve at some later date.

/var/cache/apt/archives/
/var/cache/apt/archives/partial/
darthlukan
  • 701
  • 6
  • 6
1

The whereis command can be very helpful in a situation like this. For example, to look for the program "gedit" you would type the following in a terminal as ~$ . . .

whereis gedit

The output should show the corresponding directories for the installed program. Also, the whatis command will tell you what the program is.

mchid
  • 43,546
  • 8
  • 97
  • 150