Where is a typical Linux program installed

13

3

I mean not just the binary, but its libraries, config files and data (strictly speaking all files). Also when I download a package where is it best to extract it. If I move these files will the app be corrupted?

Tihomir Mitkov

Posted 2011-05-16T19:59:53.803

Reputation: 387

7On non-mobile OSes, "app"s are called either programs or applications. I personally hate that word already.. – Bora – 2011-05-16T20:19:52.607

1That was a really good question btw, Tichomir. – Blomkvist – 2011-05-16T20:22:41.590

2@Bora: "app" is just shortened form of "application", and was in use way before the smartphone craze. – user1686 – 2011-05-16T22:05:36.080

@grawity: I'd like to see your source, primarily to deepen my hate in its history. – Bora – 2011-05-17T06:10:16.057

Answers

17

  • Most programs follow the Filesystem Hierarchy Standard (man hier): libraries go to /usr/lib, configuration files to /etc, static data to /usr/share, and so on.

    Some self-contained programs put all data in /opt/<program>/.

  • .deb/.rpm packages are not supposed to be unpacked manually – they should be handled by the apropriate program, dpkg or rpm.

    If you have only the source code in a tarball, you must extract it to a temporary location (somewhere to /tmp or $HOME). The rest, including installation is usually handled by the Makefile (by running make install); see FHS above.

user1686

Posted 2011-05-16T19:59:53.803

Reputation: 283 655

1Note that FHS version 3 is currently in progress, and the layout may change somewhat. – user1686 – 2011-05-16T20:18:45.167

And indeed, once you have used the .deb or .rpm file, it is no longer needed. If I download a random .deb file, I usually download it to /tmp, or my home directory if I may need it again on a different box. When apt downloads a package, it is stored in /var/cache/apt from where it will eventually be cleaned out. – tripleee – 2012-08-16T03:52:14.393

2

The Filesystem Hierarchy Standard describes the directory layout used on Linux.

Florian Diesch

Posted 2011-05-16T19:59:53.803

Reputation: 3 380