1

I am not a pro in Linux and I was thinking that where does the files get stored when I do apt-get install.

I understand that different linux distributions do things differently, but I am taking a generic case here.

I read the RUTE documentation, and other answers on stackexchange.

Now, my question is that say I have two users A and B.

This means, I will have two directories /home/A and /home/B (RIGHT?)

Now, if user A installs anything, none of the installation go in the home directory. But they are installed in /usr directory.

Now, the binary file will go in /usr/bin If it uses any libraries that goes in /usr/lib etc etc. (RIGHT?)

So, if I login as B and try to run the program installed by A,

  1. Will I be able to run it? what all factors determine that.
  2. How does the system differentiate that what softwares installed in /usr are installed by which user. I am assuming that if user B now installs something else, then all the data related to that will also be in /usr/ directory (RIGHT?)
  3. Also, any of the packages installed by any of the user do not go in /bin folder right? That is specific to system binaries.
  4. What if there are no users on my system. Will there be no files in /usr folder? ie in my office, when I remote login to a server, it shows no user in home directory.

Thanks.

2 Answers 2

1

Will I be able to run it? what all factors determine that.

Yes. But there a no factors? If it is there is can be executed. If an admin wants to prevent execution (s)he needs to use a tool to block access (acl is one of those tools).

How does the system differentiate that what softwares installed in /usr are installed by which user.

It does not and does not need to. The admin installs the software, the users use it and by default with no restrictions.

I am assuming that if user B now installs something else, then all the data related to that will also be in /usr/ directory (RIGHT?)

If B is a normal user he is unlikely to be able to install since he will need the admin password. If A and B are admin then the admin installs software (it does not matter if that admin is user A or user B).

Software that needs to store settings or data will store this in the users home. The software is installed once but the user content (settings, personal data) is shared over all of the users /home's.

Also, any of the packages installed by any of the user do not go in /bin folder right? That is specific to system binaries.

Yes. /bin is supposed to be clear of any non-system binaries. But is depends on what is installed: it could be software that has a system binary and that will end up in /bin or /sbin if applicable.

What if there are no users on my system. Will there be no files in /usr folder? ie in my office, when I remote login to a server, it shows no user in home directory.

That does not mean there are no users. If you remote login on my server I would shield my /home/ from you.

Every Linux system MUST have at least 1 user. At a minimum there must be an admin (could be root or a normal user with sudo permissions).

2
  • Thanks alot. yeah, I see /root directory. Maybe that is the user on that system (atleast). Thanks again.
    – Kraken
    Sep 9, 2014 at 9:09
  • Very likely. root does not get a /home/root ;) but a /root as home. Technically someone could change the location for the users. Some Unixes use /usr/home/ for instance.
    – Rinzwind
    Sep 9, 2014 at 9:11
1

Beware that some software do no go to /usr/bin, but will use /opt/myprojet or /home/myproject, and you have to put /opt/myproject/bin on you $PATH.

By default most software install are owned by root or bin, and anyone, A and B n your example will/could use it.

Some software, I think about Oracle are owned by a different user, in which case you (A or B) have to be of a specific group.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .