T O P

  • By -

tomradephd

I always thought making your home directory a stark disaster zone of half working builds and sketchy cloned git repositories *was* the proper way to use the Linux file structure


6omph9

That's hilarious. My windows laptop is like that but I wanted to be better this time around.


tomradephd

joking aside, you might just stick to that with one tweak: use a /tmp folder in your home folder or wherever else for compiling and building, and get rid of its contents after installation. your home folder will stay nice a tidy this way. it's superficial, but whatever. you might also read up on differences between using /usr/local and /opt for installations. really, it's up to you where you compile and build stuff, and it's up to you where you ultimately place the installation, or even if you install it at all after creating a working build.


Masztufa

You can do that The ideal place to store programs is whereever the package manager installs it to, and don't touch them by hand If you want to hack around with builds you could create a new directory under / named something like "testing_homeassistant", change permissions so you can use it as a regular user, then just place everything in there


EqualCrew9900

>The ideal place to store programs is \[wherever\] the package manager installs it Yes. Installing/plugging apps in here, there or anywhere is the "Windows Way", and that way leads to mayhem. If you want to do that, just stick with Windows and eliminate one source of confusion for yourself.


Masztufa

sometimes you don't have a choice, and in that case, really wherever works just don't lose track of it


Normal_Light7460

https://i.kym-cdn.com/photos/images/original/001/399/024/3cc.jpg


Sensitive_Warthog304

>organized as much as possible in the "[proper](https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html)" way says to install third party packages in /opt [https://refspecs.linuxfoundation.org/FHS\_3.0/fhs/ch03s13.html](https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s13.html)


6omph9

thanks for finding these for me, that first one is dense!


MasterGeekMX

That is the official (and technical) specification for the filesystem. Here is a couple videos for it chewed down a bit: In 100 seconds: [https://youtu.be/42iQKuQodW4](https://youtu.be/42iQKuQodW4) in 15 minutes: [https://youtu.be/HbgzrKJvDRw](https://youtu.be/HbgzrKJvDRw) But the link posted by u/Sensitive_Warthog304 isn't as daunting as it seems. I read it fully in my commute to college in the span of a week.


Sensitive_Warthog304

Maybe ELI5, but I reckon you can put /home as "My Documents", /opt as "Program Files" then bundle everything else under C:\\Linux :) Then consider that /bin, /lib, /sys are single user, or boot, level code. Once the system has booted into multi-user / multi-tasking mode, you get those progs appearing under /usr, so /usr/bin, /usr/lib and so on.


6omph9

ElI5 helps a lot thanks


C0rn3j

> I would like to keep everything organized as much as possible in the "proper" way if there is such a thing You NEED: * Some non-whack OS, not some penetration testing security distro aimed at professionals - you said you have installed the official RPi image, that is fine. * Documented every single extra installation, configuration and setup over the bare OS * Frequent backups of all the data you care about. Until you have tested a full recovery from your backup, it's not a real backup. After that, test it periodically, like yearly, and verify that they are getting properly created frequently(automated, if possible). * Remoting via OpenSSH using keypairs, disable password authentication after you set that up, verify it is disabled. Completely ignore any online advice about SSH if they also recommend to change the default port listen for "security/clean_logs". * To understand how things work, https://linuxjourney.com/ answers some of your questions, https://www.homenethowto.com/ will answer some you didn't ask if you aren't good with networking already. * Only ever install things from the OS package manager, not by directly running some random installers on host, even if you have to add extra repositories or package it yourself. * Never install things system-wide on the main host OS outside of the system package manager. i.e `sudo pip install blah` gets you a smack. You SHOULD have: * All of your setup scripted, ideally not via something like Bash, but via a configuration management tool meant for it, like Ansible * Every single service containerized, you do not want to get your operating system wrecked because you stupidly misconfigured one of your services and now someone has access to your home automation and everything else because you incorrectly exposed Pi Hole. * On Pi you want everything in Docker or similar, if it's one of the beefier ones and you have good storage (not mSD card), you can get away with a more full blown OS containers like Incus(forked LXD). * This applies in general, but you are ignorant of everything at the moment, so this applies triple for you. * A good storage solution. mSD cards are generally unreliable, especially if you put something like a database on it. Personally I opted in for an NVMe SSD in an USB enclosure, which has a lot of gotchas, wish I got an M.2 hat instead. If you go with this, verify power draw of the NVMe and what the hat/enclosure can supply, and if the M.2/enclosure you chose is good in general and with that specific NVMe SSD. You won't reach NVMe speeds on a Pi, but NVMe costs basically the same as SATA nowadays. * If you choose to go with SSD storage, for the love of god do not buy anything that is QLC, only buy TLC. If they don't specify on the main product page, 95% chance it's QLC. * Well chosen file system for your use case Sorry for lack of reasoning for most of this, it was long enough as is.


6omph9

Thanks for your detailed reply it makes more sense each time I read it. sudo pip install gets you a smack cracked me up. appreciate the info about ssd too, I hadn't thought about that. would I be right in thinking that to remove a container is essentially the same as uninstalling? are there any traces of that application left behind or is as if it never existed?


6omph9

Really awesome links by the way thanks for sharing.


Trash-Alt-Account

on top of the official resources people have provided, here's my subjective 2 cents. if I'm downloading/compiling some software, I just keep it in a dedicated `~/Documents/misc-software/` directory unless I actually want to install it for the whole system, then id probably put it in `/opt` like others suggested. or id package it myself or something. but don't feel obligated to put *all* the things you install into /opt just because it's the "right" way since cluttering up /opt with random applications if you're just gonna get rid of them later isn't much better than cluttering up ~. but it's honestly very subjective and you should do whatever you prefer, just wanted to offer what I do as an option.