From 53a263524014cc017ad266f0c90bdaedf6781947 Mon Sep 17 00:00:00 2001 From: Gabriel David Pragin Date: Thu, 1 Jan 2026 10:09:19 -0800 Subject: [PATCH] fix(bazarr): update script now migrates old service files to use venv Python (#10459) - Separates venv creation from service file migration logic - Always checks and fixes service file if it uses /usr/bin/python3 - Fixes installations created before October 28, 2025 that upgraded to Debian 13 - Ensures all users running update script get automatic migration - Idempotent: safe to run multiple times Resolves issue where Bazarr fails to start on Debian 13 with 'externally-managed-environment' error for installations created before the October 28, 2025 fix (commit 909dbc20c). Related: #7332 --- ct/bazarr.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ct/bazarr.sh b/ct/bazarr.sh index c7e540113..3268b844e 100755 --- a/ct/bazarr.sh +++ b/ct/bazarr.sh @@ -38,8 +38,13 @@ function update_script() { msg_info "Setup Bazarr" mkdir -p /var/lib/bazarr/ chmod 775 /opt/bazarr /var/lib/bazarr/ + # Always ensure venv exists if [[ ! -d /opt/bazarr/venv/ ]]; then $STD uv venv /opt/bazarr/venv --python 3.12 + fi + + # Always check and fix service file if needed + if [[ -f /etc/systemd/system/bazarr.service ]] && grep -q "ExecStart=/usr/bin/python3" /etc/systemd/system/bazarr.service; then sed -i "s|ExecStart=/usr/bin/python3 /opt/bazarr/bazarr.py|ExecStart=/opt/bazarr/venv/bin/python3 /opt/bazarr/bazarr.py|g" /etc/systemd/system/bazarr.service systemctl daemon-reload fi