Where does Ubuntu install new programs? [duplicate]

I'm planning on having the OS both in a partitioned SSD and HDD to take advantage of an M.2 drive while having the space in the normal HDD. But where's does the programs get installed by default?

As far as I know, I can use the / partition in the SSD for faster boot times and the /home one for everything else. But I also would like that some programs (browser and Netbeans por example) get the benefit of the SSD and load quicker.

In here its mentioned as another option that both / and /home can be in the SSD and everything else in the HDD, but idk if this is what i want.


Programs generally get installed to the root partition, unless you are doing something really fancy. As a beginner (only beginners ask this common question), you won't able to change the location that applications install to. So don't scrimp on your root (/) partition size.

Opinion: If your root (/) and /home are on the same disk, then there seems no point to have separate partitions for them. You can if you wish, and it was quite popular to do so a decade ago, but you are unlikely to see much benefit nowadays.

Advice: Many start out thinking along the lines you describe. After a few months, with real usage experience, they discover that they want (or need) to re-partition and sometimes even re-install. Be prepared for that: Document your customizations and installs so you can reproduce them on a fresh system. Have adequate backup capacity available. Have adequate unallocated space available. And hang on to your LiveUSB (or write down the link to re-create one).