Where do new packages get installed?

Expanding on what @cscs wrote:

TL;DR

  • Windows uses multiple disks or partitions under multiple drive letters
  • Linux uses the Linux Filesystem Hierarchy Standard and has only one filesystem (/- that can reside on multiple partitions, not disks like Windows and any partition can be mounted anywhere.
    • /boot contains all the bootloader files (GRUB, kernel files, …)

    • /bin, /sbin: contains user binaries and system binaries (aka sudo binaries) respectively

    • /etc contains system configuration files.

    • /home contains user data and user config files (E.G. if you have one user who sets their resolution to HD whereas you have a UHD screen that’s where this is set)

    • /root contains the home directory for the root user.

    • /lib contains shared libraries that the essential binaries in /bin and /sbin need to be able to run and where kernel modules are stored.

    • /usr contains the UNIX system resources and is intended to be a read-only directory that stores files that aren’t required to boot the system. In general, when you install additional software from your distribution, its binaries, libraries and supporting files go here in their corresponding /usr/bin, /usr/sbin or /usr/lib directories.

    • /opt: contains “optional” software. In general, this is where games install themselves..
      If you would want to move /opt to your HDD, just:

      1. create a new partition on your HDD twice the size of your current /opt
      2. Boot from a USB drive
      3. Copy all files from the old /opt to the new /opt
      4. Add a mount for the new /opt to your /etc/fstab
      5. shut down
      6. Remove USB stick
      7. Boot and test
      8. If OK, boot again with the USB stick
      9. Delete the old /opt (as you copied, remember and if anything went wrong with your fstab, you can just take out the line you added and be back where you started
      10. Reboot again.

The long version:

  • Most people run / on their SSD and /home on their HDD, just like you do.
  • You can move any directory on any partition by using an extra mount in your fstab . For more information read man mount.
    E.G. I have both / and /home on my SSD, but my Music and Videos are on the HDD)
  • Read the full FHS standard (V3.0 at the time of this writing) here and why this is the long version as that’s 43 pages… :smiling_imp:
4 Likes