Should you ever add anything to /bin?

There was a post on FB, and the person kept insisting I was wrong and should be manually adding binaries to /bin. Do they have any point that I’m just missing?

It’s usually best to just go to the docs if there’s disagreement.

“The /usr/ directory is for files that can be shared across multiple machines.”

3.2. Overview of File System Hierarchy Standard (FHS) Red Hat Enterprise Linux 4 | Red Hat Customer Portal

“The /usr/local hierarchy is for use by the system administrator when installing software locally. It needs to be safe from being overwritten when the system software is updated.”

3.2. Overview of File System Hierarchy Standard (FHS) Red Hat Enterprise Linux 4 | Red Hat Customer Portal

The key is in the special distinction for /usr/local, “It needs to be safe from being overwritten when the system software is updated.”

Arbitrarily placing files in /usr/ outside of /usr/local/ is unsafe because the package manager doesn’t know they’re there so if there’s a name collision during an update or installation it’ll error or overwrite them. Same is true of /bin/.

2 Likes

In some distributions (like Arch) /bin is a symlink to /usr/bin.

My approach is that anything you place manually (eg, not via a package manager) should be in /usr/local or ~/.local.

The user is likely going with the FHS.

Which also does mention this:

Some Linux distributions no longer differentiate between /lib and /usr/lib and have /lib symlinked to /usr/lib.[22]
Some Linux distributions no longer differentiate between /bin and /usr/bin and between /sbin and /usr/sbin. They may symlink /bin to /usr/bin and /sbin to /usr/sbin. Other distributions choose to consolidate all four, symlinking them to /usr/bin.[23]
1 Like

Thank-you. I should have thought to point Angel to the official documentation

I’m not sure where Wikipedia is getting their summary or if the author generated it themselves but they cite the Linux Foundation as the official maintainers.

Red Hat quotes the foundation verbatim for /usr/local and they’re similar for /usr.

I agree Linux Foundation would be the better source for citing the general standard though.

" /usr is the second major section of the filesystem. /usr is shareable, read-only data. That means that /usr should be shareable between various FHS-compliant hosts and must not be written to."

Chapter 4. The /usr Hierarchy

" The /usr/local hierarchy is for use by the system administrator when installing software locally. It needs to be safe from being overwritten when the system software is updated."

4.9. /usr/local : Local hierarchy