The author details their method for installing and managing personal versions of software on Unix systems, emphasizing a clean, organized approach. They create a dedicated directory within their home folder (e.g., ~/software
) to house all personally installed programs. Within this directory, each program gets its own subdirectory, containing the source code, build artifacts, and the compiled binaries. Critically, they manage dependencies by either statically linking them or bundling them within the program's directory. Finally, they modify their shell's PATH
environment variable to prioritize these personal installations over system-wide versions, enabling easy access and preventing conflicts. This method allows for running multiple versions of the same software concurrently and simplifies upgrading or removing personally installed programs.
The blog post argues against using generic, top-level directories like .cache
, .local
, and .config
for application caching and configuration in Unix-like systems. These directories quickly become cluttered, making it difficult to manage disk space, identify relevant files, and troubleshoot application issues. The author advocates for application developers to use XDG Base Directory Specification compliant paths within $HOME/.cache
, $HOME/.local/share
, and $HOME/.config
, respectively, creating distinct subdirectories for each application. This structured approach improves organization, simplifies cleanup by application or user, and prevents naming conflicts. The lack of enforcement mechanisms for this specification and inconsistent adoption by applications are acknowledged as obstacles.
HN commenters largely agree that standardized cache directories are a good idea in principle but messy in practice. Several point out inconsistencies in how applications actually use $XDG_CACHE_HOME
, leading to wasted space and difficulty managing caches. Some suggest tools like bcache
could help, while others advocate for more granular control, like per-application cache directories or explicit opt-in/opt-out mechanisms. The lack of clear guidelines on cache eviction policies and the potential for sensitive data leakage are also highlighted as concerns. A few commenters mention that directories starting with a dot (.
) are annoying for interactive shell users.
Summary of Comments ( 11 )
https://news.ycombinator.com/item?id=43662031
HN commenters largely appreciate the author's approach of compiling and managing personal software installations in their home directory, praising it as clean, organized, and a good way to avoid dependency conflicts or polluting system directories. Several suggest using tools like
stow
or GNU Stow for simplified management of this setup, allowing easy enabling/disabling of different software versions. Some discuss alternatives like Nix, Guix, or containers, offering more robust isolation. Others caution against potential downsides like increased compile times and the need for careful dependency management, especially for libraries. A few commenters mention difficulties encountered with specific tools or libraries in this type of personalized setup.The Hacker News post "How I install personal versions of programs on Unix" (linking to a blog post detailing a user's preference for installing software in their home directory) sparked a lively discussion with 29 comments. Many commenters resonated with the author's desire for a clean, self-contained software environment, separate from the system-wide installations.
Several users shared their preferred methods for achieving similar results. Some championed the use of tools like
stow
for managing multiple versions of programs installed in their home directory, highlighting its simplicity and effectiveness in creating symbolic links to the desired versions. Others advocated for environment modules, emphasizing their flexibility in switching between different software versions and configurations on the fly. A few mentioned containers (like Docker) and virtual machines as more heavyweight but ultimately more isolated solutions for managing software dependencies and versions.A significant thread of the conversation revolved around the pros and cons of the author's approach compared to more modern alternatives. Some commenters pointed out potential drawbacks, such as increased disk space usage due to redundant installations and the potential for conflicts if not managed carefully. Others countered that the benefits of isolation and control over software versions outweighed these concerns, particularly for development or testing environments.
Some compelling comments included:
Overall, the comments section reflects a shared understanding of the challenges and benefits of managing personal software installations on Unix-like systems. It provides a valuable overview of different approaches and tools available, ranging from simple shell scripts to sophisticated package managers, while highlighting the ongoing evolution of best practices in this area.