This seems totally obvious to me now, but I only made this change about 6 months
ago, so it’s possible others may have similarly overlooked it: on single user
Unix operating systems (e.g. OS X, Linux virtual machines), if you change the
ownership of /usr/local to your own user and own group, then you can safely
let various command-line install scripts run with their default settings, and
not under sudo, without worrying that they’ll unexpectedly change some system
files. (Well-behaved scripts will usually install into /usr/local, but you
can’t be sure that they will—this way, changing /usr/local will be allowed,
but everything else not.)
I used to try to install into $HOME by passing switches to the various
command-line installers, but it got too difficult to figure out how the various
perl and ruby and python installers worked. (./configure --prefix="$HOME/local" --exec-prefix="$LOCAL" is actually pretty reliable, though, where $LOCAL is
an architecture-specific directory like $HOME/local-darwin.)