5

I understand that I have the /computer/usr/share path as well as the /computer/opt path. I noticed sometimes, like with programs such as Google Chrome and Teamviewer, they automatically installed themselves in my /computer/opt directory. However, for programs such as VSCode, I had to manually move the tar.gz file into my /opt directory, and then extract there. Why do some programs do this automatically, while others have to be done manually?

Also, when installing programs, what is the best directory to install them in? (i.e. what is the Linux equivalent to Program Files (x86) for Windows?)

Thank you.

1 Answers1

8

There is no C:\Program Files\ in linux "per se". Therefore it doesn't exist one single (default) place where programs where to install. Actually many linux programs installs all over the place, parts of them installs in different folders. That's happening for performance optimization - one of many reasons why linux runs faster than Windows.

Best practice is to allow the program to install wherever it wants. Don't worry about volume fragmentation. That's virtually non-existent in linux.

The same thing happens in Windows too, when some big programs are installing files in ProgramData or CommonFiles folders. I've seen programs installing in Program Files (x64) and their respective Licence Key Server installing in Program Files (x86). Many specific user data may install in C:\Users\Documents\.

When a program uses many per-user options and files, it ussually installs to /usr/share. When it does not, it ussually installs to /opt. You could say that /usr is the equivalent of Users folder from Windows. /opt stands for optional software (that doesn't come bundled with the Ubuntu original disk).

For in-depth details of where and how linux programs are installed, please see this topic: Where are my installed applications

There is no single Program Files because of security reasons. Trusted applications (verified by the Software Center) may install in more sensitive places like /bin (=binaries) or even /sbin (=superbinaries), while untrusted (unverified) apps are installed in secure and secluded locations like /opt.

ipse lute
  • 2,614