2

I'm trying to understand the file structure of Linux systems.(At least basic parts).

Now, according to this answer, /usr/local - directory is for read-only files installed by the local administrator (usually, you). And that's why most directory names from /usr are duplicated here.

Here is my question - I decided to install g++ compiler. So it is a program which will be installed by me (local admin). However, it has been installed on usr/bin instead of usr/local/bin. What is the reason for that?

EDIT

$ which g++
/usr/bin/g++

$ ll $(which g++)
lrwxrwxrwx 1 root root 7 Nis  8  2014 /usr/bin/g++ -> g++-4.8*
4
  • 1
    Please post the outputs of which g++ and ll $(which g++) by editing your question.
    – Byte Commander
    Jul 25, 2015 at 9:35
  • @ByteCommander I editted it Jul 25, 2015 at 9:40
  • How did you install g++ ?
    – solsTiCe
    Jul 25, 2015 at 10:17
  • sudo apt-get install g++ @solsTiCe Jul 25, 2015 at 10:19

1 Answer 1

0

It depends on how you install it.

Usually packages install most of their files under /usr only. Even if it's you, the admin, that installs the package.

"installed by the admin" means installed by hand i.e. without the package manager. This means either by copying files in /usr/local directly or via make install command.

But this is just a recommendation and the admin can do whatever she wants and install manually in /usr if she wishes too. These are just guidelines. Noone is there to enforce those rules.

2
  • thanks for info, so its installed on /usr/bin because of my way of installing it right? Jul 25, 2015 at 10:25
  • 1
    @stackunderflow here's mine: /usr/lib/hardening-wrapper/bin/g++. Most will be installed under /usr.
    – xyz
    Jul 25, 2015 at 10:30

You must log in to answer this question.

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