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.
Chris Siebenmann's blog post, "How I install personal versions of programs on Unix," details his meticulous approach to managing multiple versions of software on his Unix systems, prioritizing cleanliness and avoiding conflicts with system-wide installations. He outlines a structured process that ensures his personal programs remain isolated and easily manageable, while also allowing for system-wide upgrades without disrupting his personalized setup.
The core of Siebenmann's method revolves around creating dedicated directories for each program. He uses a top-level directory, such as ~/local
, to house all personally installed software. Beneath this, individual program installations reside in clearly named directories, often incorporating version numbers for easy differentiation. For example, ~/local/bin/python3.11
might hold a personal installation of Python 3.11. This structure allows him to keep multiple versions of the same program readily accessible.
A key aspect of this organizational scheme is the manipulation of the PATH environment variable. Siebenmann modifies his PATH to prioritize the directories containing his personal program binaries. This ensures that when he executes a command, his preferred version, located within his personal installation directory, takes precedence over the system-wide version. He notes the importance of the order in which directories are added to the PATH, as this determines the precedence of different versions.
The post further emphasizes the practice of compiling programs from source when possible. This grants him fine-grained control over the installation process and allows him to customize the software to his specific needs. When installing from source, he installs into his designated personal directories, maintaining the established organizational structure.
Siebenmann explicitly avoids using tools like stow
or checkinstall
, preferring the directness and transparency of manual installation. This provides him with a clear understanding of where files are located and how his system is configured. He highlights the benefits of this approach for debugging and troubleshooting, as it simplifies the process of identifying and resolving issues.
Furthermore, the blog post advocates for creating separate configuration files for personal program installations. This prevents interference with system-wide configurations and allows for personalized settings without impacting other users or system stability. This meticulous approach to configuration management enhances the overall organization and maintainability of his personalized software environment.
In essence, Siebenmann's method champions a highly organized and self-contained approach to personal software management on Unix systems. Through careful directory structuring, PATH manipulation, and manual installation practices, he maintains a clean, efficient, and easily manageable personal software environment that coexists harmoniously with the system-wide installations.
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.