#!/bin/bash # Install Hugo Extended on Ubuntu LXC container # Run as root or with sudo set -e echo "Installing Hugo Extended on Ubuntu..." # Check current Hugo version if command -v hugo &> /dev/null; then echo "Current Hugo version:" hugo version fi # Remove old Hugo from apt if installed echo "Removing old Hugo installation..." apt remove -y hugo 2>/dev/null || true # Add Hugo APT repository echo "Adding Hugo APT repository..." ARCH=$(dpkg --print-architecture) echo "deb [arch=${ARCH} signed-by=/etc/apt/keyrings/hugo.gpg] https://hugo-apt.8hob.io latest main" | tee /etc/apt/sources.list.d/hugo.list chmod 644 /etc/apt/sources.list.d/hugo.list # Add signing key mkdir -p /etc/apt/keyrings wget -O /etc/apt/keyrings/hugo.gpg https://hugo-apt.8hob.io/signing-key chmod 644 /etc/apt/keyrings/hugo.gpg # Pin repository priority cat > /etc/apt/preferences.d/hugo <