This guide installs Spack in /opt/spack and validates a basic package workflow.
sudo apt-get update
sudo apt-get install -y git python3 build-essential
sudo git clone https://github.com/spack/spack.git /opt/spack
For controlled deployments, pin a release branch or tag.
source /opt/spack/share/spack/setup-env.sh
spack --version
spack compiler find
spack install zlib
Add /opt/spack/share/spack/setup-env.sh sourcing to profile scripts.
Choose the deployment method that fits your infrastructure:
Install Spack directly on the host system for full-featured package management.
Run Spack in Docker containers for isolated build workflows and testing.