The officially official Devuan Forum!

You are not logged in.

#1 2023-05-31 20:27:31

Danielsan
Member
Registered: 2020-07-14
Posts: 178  

/bin vs /usr/bin

Hi guys,

what is the main difference between /bin and /usr/bin and what do you think about this last Debian decision? Thanks!

Files that are in /usr in the Debian 12 release should remain in /usr, while files that are in /bin, /lib* or /sbin in the Debian 12 release should remain in those directories.  If any files are moved from /bin, /lib* or /sbin into /usr after the Debian 12 release, they should be moved back to their Debian 12 locations.

https://lists.debian.org/debian-devel-a … 00002.html

Offline

#2 2023-06-01 08:49:27

Camtaf
Member
Registered: 2019-11-19
Posts: 436  

Re: /bin vs /usr/bin

Basically, /bin are standard binary files to be found on all distros, whilst /usr/bin can vary between distros, but seldom does in fact - there used to be an /opt directory which was originally for added programs, but not much used.

Also, /sbin are standard system binaries, whilst /usr/sbin could vary, but again seldom does.

Most additional software these days is for graphical desktops, & get placed in /usr/X11R6/bin

Offline

#3 2023-06-01 12:43:21

boughtonp
Member
From: UK
Registered: 2023-01-19
Posts: 212  
Website

Re: /bin vs /usr/bin

Danielsan wrote:

what is the main difference between /bin and /usr/bin

The reason they exist is described here: http://lists.busybox.net/pipermail/busy … 74114.html

Attempts to rationalise it are described here: https://refspecs.linuxfoundation.org/FH … index.html

FHS wrote:

3.4. /bin : Essential user command binaries (for use by all users)
/bin contains commands that may be used by both the system administrator and by users, but which are required when no other filesystems are mounted (e.g. in single user mode). It may also contain commands which are used indirectly by scripts
...
3.16. /sbin : System binaries
Utilities used for system administration (and other root-only commands) are stored in /sbin, /usr/sbin, and /usr/local/sbin. /sbin contains binaries essential for booting, restoring, recovering, and/or repairing the system in addition to the binaries in /bin. Programs executed after /usr is known to be mounted (when there are no problems) are generally placed into /usr/sbin. Locally-installed system administration programs should be placed into /usr/local/sbin.
...
4.4. /usr/bin : Most user commands
This is the primary directory of executable commands on the system.
...
4.10. /usr/sbin : Non-essential standard system binaries
This directory contains any non-essential binaries used exclusively by the system administrator. System administration programs that are required for system repair, system recovery, mounting /usr, or other essential functions must be placed in /sbin instead.

-

Danielsan wrote:

and what do you think about this last Debian decision?

Sounds like they've deferred the merge because they're continuing to have problems one small part of the process.

edit: updated after reading https://lwn.net/Articles/932158/#CommAnchor932182

smcv wrote:

One specific action that is mostly internal to Debian, which some developers wanted to push ahead with after the bookworm release, has been paused.

On a merged-/usr system (which will include all Debian 12 and Debian 13 systems, both new installations and upgrades), both /bin/cat and /usr/bin/cat exist, but dpkg is only aware of one of those paths (/bin/cat in this case); in dpkg jargon, the other is said to be an alias. The specific action that should not proceed until further notice is: swapping the path that dpkg considers to be canonical, for example from /bin/cat to /usr/bin/cat.

Here's a summary from a year ago: https://lwn.net/Articles/890219/

Last edited by boughtonp (2023-06-01 13:12:38)


3.1415P265E589T932E846R64338

Offline

#4 2023-06-01 19:34:40

GlennW
Member
From: Brisbane, Australia
Registered: 2019-07-18
Posts: 643  

Re: /bin vs /usr/bin

the /opt dir still has it's uses.

Backwards compat. is still happening. I remember being asked at install, do i want to merge the dir, /bin & /usr/bin...
I just say yes, what would I know... still works.


pic from 1993, new guitar day.

Offline

#5 2023-06-02 23:24:38

Danielsan
Member
Registered: 2020-07-14
Posts: 178  

Re: /bin vs /usr/bin

Thank you guys! I really appreciated it! 🙏

Offline

Board footer