From 6a302b6a5a58291610e27d836d77bc66cc6354e1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Feb 2026 19:28:10 +0000 Subject: [PATCH 01/18] Initial plan From 111e1432eeb8b1b76e19323a530ab1a862e99a9e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Feb 2026 19:33:31 +0000 Subject: [PATCH 02/18] Migrate Python software to venvs, remove global break-system-packages Co-authored-by: MichaIng <28480705+MichaIng@users.noreply.github.com> --- dietpi/dietpi-software | 137 +++++++++++++++++++++++++++++++---------- 1 file changed, 104 insertions(+), 33 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 6e4f32e882..b10babdef9 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3149,10 +3149,9 @@ _EOF_" if To_Install 130 # Python 3 then - # Allow pip to install modules on system level, and mute the warning when doing so as root (which is needed, of course) + # Mute pip warning when running as root (which is needed to create venvs owned by specific users) >> /etc/pip.conf G_CONFIG_INJECT '\[global\]' '[global]' /etc/pip.conf - G_CONFIG_INJECT 'break-system-packages[[:blank:]]*=' 'break-system-packages=true' /etc/pip.conf '\[global\]' G_CONFIG_INJECT 'root-user-action[[:blank:]]*=' 'root-user-action=ignore' /etc/pip.conf '\[global\]' # Disable cache: It is rarely ever needed to install the very same module and version twice, hence this usually only causes unnecessary disk writes and usage. @@ -3161,11 +3160,8 @@ _EOF_" # ARMv6/7: Add piwheels (( $G_HW_ARCH < 3 )) && G_CONFIG_INJECT 'extra-index-url[[:blank:]]*=' 'extra-index-url=https://www.piwheels.org/simple/' /etc/pip.conf '\[global\]' - # Perform pip3 install (which includes setuptools and wheel modules) - aDEPS=('python3-dev') - Download_Install 'https://bootstrap.pypa.io/get-pip.py' - G_EXEC_OUTPUT=1 G_EXEC python3 get-pip.py - G_EXEC rm get-pip.py + # Install python3-venv for virtual environment support + aDEPS=('python3-dev' 'python3-venv') fi if To_Install 150 # Mono: https://www.mono-project.com/download/stable/#download-lin-debian @@ -4088,12 +4084,24 @@ sudo sysctl -p /etc/sysctl.d/98-dietpi-redis.conf' # Dependencies Python_Deps -i bcrypt cryptography pillow psycopg2 pynacl matrix-synapse - # Install - G_EXEC_OUTPUT=1 G_EXEC pip3 install -U matrix-synapse psycopg2 - # User Create_User -d /mnt/dietpi_userdata/synapse synapse + # Create or recreate venv if Python version changed + local python_version=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")') + if [[ -f '/opt/synapse/bin/python3' ]] + then + local venv_version=$(/opt/synapse/bin/python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2> /dev/null) + [[ $venv_version == "$python_version" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $python_version"; G_EXEC rm -R /opt/synapse; } + fi + if [[ ! -d '/opt/synapse' ]] + then + G_EXEC python3 -m venv --system-site-packages /opt/synapse + fi + + # Install into venv + G_EXEC_OUTPUT=1 G_EXEC /opt/synapse/bin/pip3 install -U matrix-synapse psycopg2 + # Service cat << '_EOF_' > /etc/systemd/system/synapse.service [Unit] @@ -4106,7 +4114,7 @@ Type=notify SyslogIdentifier=Synapse User=synapse WorkingDirectory=/mnt/dietpi_userdata/synapse -ExecStart=/usr/bin/python3 -m synapse.app.homeserver -c homeserver.yaml -c homeserver.yaml.d +ExecStart=/opt/synapse/bin/python3 -m synapse.app.homeserver -c homeserver.yaml -c homeserver.yaml.d ExecReload=/bin/kill -HUP $MAINPID [Install] @@ -4162,7 +4170,7 @@ _EOF_ G_EXEC cd /mnt/dietpi_userdata/synapse # Create initial config - G_EXEC python3 -m synapse.app.homeserver -H "$servername" -c homeserver.yaml --generate-config --report-stats 'no' + G_EXEC /opt/synapse/bin/python3 -m synapse.app.homeserver -H "$servername" -c homeserver.yaml --generate-config --report-stats 'no' # Enable registrations via random shared secret GCI_PASSWORD=1 G_CONFIG_INJECT 'registration_shared_secret:[[:blank:]]' "registration_shared_secret: $(openssl rand -hex 16)" homeserver.yaml @@ -4183,7 +4191,7 @@ _EOF_ G_EXEC systemctl daemon-reload G_EXEC systemctl start synapse G_EXEC_PRE_FUNC(){ acommand[4]="$GLOBAL_PW"; } # Mask password in console output - G_EXEC_OUTPUT=1 G_EXEC register_new_matrix_user -u "$username" -p "${GLOBAL_PW//?/X}" -a -c homeserver.yaml 'http://127.0.0.1:8008' + G_EXEC_OUTPUT=1 G_EXEC /opt/synapse/bin/register_new_matrix_user -u "$username" -p "${GLOBAL_PW//?/X}" -a -c homeserver.yaml 'http://127.0.0.1:8008' G_EXEC cd "$G_WORKING_DIR" unset -v servername username @@ -5148,7 +5156,8 @@ _EOF_ raise exceptions.ScannerError(str(error)) elif msg.type == Gst.MessageType.EOS: _EOF_ - G_EXEC_OUTPUT=1 G_EXEC pip3 install -U Mopidy-MusicBox-Webclient + # Install additional Python modules with --break-system-packages as Mopidy itself is an APT package + G_EXEC_OUTPUT=1 G_EXEC pip3 install --break-system-packages -U Mopidy-MusicBox-Webclient # Assure user home, data and cache dir as well on custom configs G_CONFIG_INJECT 'data_dir[[:blank:]]*=' 'data_dir = /mnt/dietpi_userdata/mopidy/data' /etc/mopidy/mopidy.conf '\[core\]' @@ -8997,11 +9006,26 @@ _EOF_ # RPi: Enable camera module (( $G_HW_MODEL > 9 )) || /boot/dietpi/func/dietpi-set_hardware rpi-camera 1 - # motionEye - G_EXEC_OUTPUT=1 G_EXEC pip3 install -U motioneye - G_EXEC_OUTPUT=1 G_EXEC motioneye_init --skip-apt-update + # Create or recreate venv if Python version changed + local python_version=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")') + if [[ -f '/opt/motioneye/bin/python3' ]] + then + local venv_version=$(/opt/motioneye/bin/python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2> /dev/null) + [[ $venv_version == "$python_version" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $python_version"; G_EXEC rm -R /opt/motioneye; } + fi + if [[ ! -d '/opt/motioneye' ]] + then + G_EXEC python3 -m venv --system-site-packages /opt/motioneye + fi + + # Install into venv + G_EXEC_OUTPUT=1 G_EXEC /opt/motioneye/bin/pip3 install -U motioneye + G_EXEC_OUTPUT=1 G_EXEC /opt/motioneye/bin/motioneye_init --skip-apt-update G_EXEC systemctl stop motioneye + # Update systemd service to use venv + G_EXEC sed -i 's|ExecStart=/usr/local/bin/meyectl|ExecStart=/opt/motioneye/bin/meyectl|' /etc/systemd/system/motioneye.service + # Prevent the conflicting motion daemon from starting G_EXEC systemctl --no-reload disable --now motion G_EXEC systemctl --no-reload mask motion @@ -9136,9 +9160,21 @@ _EOF_ # Install G_EXEC mv sabnzbd-master /etc/sabnzbd + # Create or recreate venv if Python version changed + local python_version=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")') + if [[ -f '/opt/sabnzbd/bin/python3' ]] + then + local venv_version=$(/opt/sabnzbd/bin/python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2> /dev/null) + [[ $venv_version == "$python_version" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $python_version"; G_EXEC rm -R /opt/sabnzbd; } + fi + if [[ ! -d '/opt/sabnzbd' ]] + then + G_EXEC python3 -m venv --system-site-packages /opt/sabnzbd + fi + # Python deps G_EXEC cd /etc/sabnzbd - G_EXEC_OUTPUT=1 G_EXEC pip3 install -Ur requirements.txt + G_EXEC_OUTPUT=1 G_EXEC /opt/sabnzbd/bin/pip3 install -Ur requirements.txt # User Create_User -g dietpi -d /etc/sabnzbd sabnzbd @@ -9164,7 +9200,7 @@ StartLimitBurst=3 [Service] SyslogIdentifier=SABnzbd User=sabnzbd -ExecStart=/usr/bin/python3 -OO /etc/sabnzbd/SABnzbd.py -f /etc/sabnzbd/sabnzbd.ini -n --disable-file-log +ExecStart=/opt/sabnzbd/bin/python3 -OO /etc/sabnzbd/SABnzbd.py -f /etc/sabnzbd/sabnzbd.ini -n --disable-file-log Restart=on-failure [Install] @@ -9647,15 +9683,27 @@ _EOF_ # Download Download_Install 'https://github.com/morpheus65535/bazarr/releases/latest/download/bazarr.zip' bazarr - # Python deps - # - Allow Pillow to be compiled - G_EXEC sed --follow-symlinks -i 's/ --only-binary=Pillow$//' bazarr/requirements.txt - G_EXEC_OUTPUT=1 G_EXEC pip3 install -Ur bazarr/requirements.txt - # Install: Remove previous instance on reinstall [[ -d '/opt/bazarr' ]] && G_EXEC rm -R /opt/bazarr G_EXEC mv bazarr /opt + # Create or recreate venv if Python version changed + local python_version=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")') + if [[ -f '/opt/bazarr/venv/bin/python3' ]] + then + local venv_version=$(/opt/bazarr/venv/bin/python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2> /dev/null) + [[ $venv_version == "$python_version" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $python_version"; G_EXEC rm -R /opt/bazarr/venv; } + fi + if [[ ! -d '/opt/bazarr/venv' ]] + then + G_EXEC python3 -m venv --system-site-packages /opt/bazarr/venv + fi + + # Python deps + # - Allow Pillow to be compiled + G_EXEC sed --follow-symlinks -i 's/ --only-binary=Pillow$//' /opt/bazarr/requirements.txt + G_EXEC_OUTPUT=1 G_EXEC /opt/bazarr/venv/bin/pip3 install -Ur /opt/bazarr/requirements.txt + # Data dir G_EXEC mkdir -p /mnt/dietpi_userdata/bazarr @@ -9682,7 +9730,7 @@ User=bazarr UMask=002 LogsDirectory=bazarr WorkingDirectory=/mnt/dietpi_userdata/bazarr -ExecStart=/usr/bin/python3 /opt/bazarr/bazarr.py -c /mnt/dietpi_userdata/bazarr +ExecStart=/opt/bazarr/venv/bin/python3 /opt/bazarr/bazarr.py -c /mnt/dietpi_userdata/bazarr KillSignal=SIGINT TimeoutStopSec=20 @@ -10058,7 +10106,18 @@ _EOF_ fi # Python deps - G_EXEC_OUTPUT=1 G_EXEC pip3 install -Ur requirements.txt + # Create or recreate venv if Python version changed + local python_version=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")') + if [[ -f '/opt/htpc-manager/bin/python3' ]] + then + local venv_version=$(/opt/htpc-manager/bin/python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2> /dev/null) + [[ $venv_version == "$python_version" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $python_version"; G_EXEC rm -R /opt/htpc-manager; } + fi + if [[ ! -d '/opt/htpc-manager' ]] + then + G_EXEC python3 -m venv --system-site-packages /opt/htpc-manager + fi + G_EXEC_OUTPUT=1 G_EXEC /opt/htpc-manager/bin/pip3 install -Ur requirements.txt # Service cat << '_EOF_' > /etc/systemd/system/htpc-manager.service @@ -10069,7 +10128,7 @@ After=network-online.target [Service] SyslogIdentifier=HTPC Manager -ExecStart=/usr/bin/python3 -OO /mnt/dietpi_userdata/htpc-manager/Htpc.py +ExecStart=/opt/htpc-manager/bin/python3 -OO /mnt/dietpi_userdata/htpc-manager/Htpc.py [Install] WantedBy=multi-user.target @@ -10089,9 +10148,21 @@ _EOF_ # Clear pip cache in case it got somehow created [[ -d '/mnt/dietpi_userdata/octoprint/.cache' ]] && G_EXEC rm -R /mnt/dietpi_userdata/octoprint/.cache + # Create or recreate venv if Python version changed, owned by octoprint user + local python_version=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")') + if [[ -f '/mnt/dietpi_userdata/octoprint/venv/bin/python3' ]] + then + local venv_version=$(/mnt/dietpi_userdata/octoprint/venv/bin/python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2> /dev/null) + [[ $venv_version == "$python_version" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $python_version"; G_EXEC rm -R /mnt/dietpi_userdata/octoprint/venv; } + fi + if [[ ! -d '/mnt/dietpi_userdata/octoprint/venv' ]] + then + G_EXEC runuser -u octoprint -- python3 -m venv --system-site-packages /mnt/dietpi_userdata/octoprint/venv + fi + # Install OctoPrint # shellcheck disable=SC2016 - G_EXEC_OUTPUT=1 G_EXEC runuser -u octoprint -- dash -c 'PATH="$HOME/.cargo/bin:$PATH" pip3 install -U --user --no-warn-script-location octoprint' + G_EXEC_OUTPUT=1 G_EXEC runuser -u octoprint -- dash -c 'PATH="$HOME/.cargo/bin:$PATH" /mnt/dietpi_userdata/octoprint/venv/bin/pip3 install -U octoprint' # Service: https://github.com/OctoPrint/OctoPrint/blob/master/scripts/octoprint.service cat << '_EOF_' > /etc/systemd/system/octoprint.service @@ -10104,16 +10175,16 @@ After=network-online.target mjpg-streamer.service [Service] Environment="LC_ALL=C.UTF-8" "LANG=C.UTF-8" User=octoprint -ExecStart=/mnt/dietpi_userdata/octoprint/.local/bin/octoprint serve +ExecStart=/mnt/dietpi_userdata/octoprint/venv/bin/octoprint serve [Install] WantedBy=multi-user.target _EOF_ # CLI alias - echo "alias octoprint='sudo -u octoprint /mnt/dietpi_userdata/octoprint/.local/bin/octoprint'" > /etc/bashrc.d/dietpi-octoprint.sh + echo "alias octoprint='sudo -u octoprint /mnt/dietpi_userdata/octoprint/venv/bin/octoprint'" > /etc/bashrc.d/dietpi-octoprint.sh # On fresh installs, change listening port to 5001 to avoid conflict with Shairport Sync. - [[ -f '/mnt/dietpi_userdata/octoprint/.octoprint/config.yaml' ]] || G_EXEC runuser -u octoprint -- /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set server.port '5001' + [[ -f '/mnt/dietpi_userdata/octoprint/.octoprint/config.yaml' ]] || G_EXEC runuser -u octoprint -- /mnt/dietpi_userdata/octoprint/venv/bin/octoprint config set server.port '5001' # Apply service and system commands: Allow execution via specific sudoers config, use "which" for "reboot" and "poweroff", since we create shell functions in dietpi-globals to bypass logind calls if logind is not running. # shellcheck disable=SC2230 @@ -11655,8 +11726,8 @@ _EOF_ G_EXEC rm -f os.adsb.feeder.image G_EXEC touch app.adsb.feeder.image - # get the Python modules - G_EXEC_OUTPUT=1 G_EXEC pip3 install -U flask requests + # get the Python modules with --break-system-packages as ADS-B services control their own Python environment + G_EXEC_OUTPUT=1 G_EXEC pip3 install --break-system-packages -U flask requests # finally ensure that /run allows executables (this is needed for the containers to be able to not do excessive # writes to physical storage - which might be an SD card) From 32216c0178d340e581c443e0339072dcd8f4c2a3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Feb 2026 19:34:58 +0000 Subject: [PATCH 03/18] Update uninstall sections to remove venvs Co-authored-by: MichaIng <28480705+MichaIng@users.noreply.github.com> --- dietpi/dietpi-software | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index b10babdef9..6df2b4ca73 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -12814,8 +12814,8 @@ _EOF_ then Remove_Service synapse 1 1 [[ -d '/mnt/dietpi_userdata/synapse' ]] && G_EXEC rm -R /mnt/dietpi_userdata/synapse + [[ -d '/opt/synapse' ]] && G_EXEC rm -R /opt/synapse - command -v pip3 > /dev/null && G_EXEC_OUTPUT=1 G_EXEC pip3 uninstall -y matrix-synapse command -v dropdb > /dev/null && runuser -u postgres -- dropdb synapse command -v dropuser > /dev/null && runuser -u postgres -- dropuser synapse fi @@ -12871,7 +12871,7 @@ _EOF_ if To_Uninstall 136 # motionEye then Remove_Service motioneye - command -v pip3 > /dev/null && G_EXEC_OUTPUT=1 G_EXEC pip3 uninstall -y motioneye + [[ -d '/opt/motioneye' ]] && G_EXEC rm -R /opt/motioneye G_AGP motion [[ -d '/etc/motioneye' ]] && G_EXEC rm -R /etc/motioneye [[ -d '/var/log/motioneye' ]] && G_EXEC rm -R /var/log/motioneye @@ -12904,6 +12904,7 @@ _EOF_ if To_Uninstall 139 # SABnzbd then Remove_Service sabnzbd 1 1 # group for pre-v6.33 + [[ -d '/opt/sabnzbd' ]] && G_EXEC rm -R /opt/sabnzbd [[ -d '/etc/sabnzbd' ]] && G_EXEC rm -R /etc/sabnzbd [[ -d '/mnt/dietpi_userdata/downloads/sabnzbd_admin' ]] && G_EXEC rm -R /mnt/dietpi_userdata/downloads/sabnzbd_admin [[ -d '/mnt/dietpi_userdata/downloads/sabnzbd_nzb_backup' ]] && G_EXEC rm -R /mnt/dietpi_userdata/downloads/sabnzbd_nzb_backup @@ -13081,6 +13082,7 @@ _EOF_ if To_Uninstall 155 # HTPC Manager then Remove_Service htpc-manager + [[ -d '/opt/htpc-manager' ]] && G_EXEC rm -R /opt/htpc-manager [[ -d '/mnt/dietpi_userdata/htpc-manager' ]] && G_EXEC rm -R /mnt/dietpi_userdata/htpc-manager fi From 805e7c2d22392b3950276fbeb2e3fa27664a362a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Feb 2026 19:36:26 +0000 Subject: [PATCH 04/18] Make motionEye sed command more robust Co-authored-by: MichaIng <28480705+MichaIng@users.noreply.github.com> --- dietpi/dietpi-software | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 6df2b4ca73..bc862727e6 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -9023,8 +9023,8 @@ _EOF_ G_EXEC_OUTPUT=1 G_EXEC /opt/motioneye/bin/motioneye_init --skip-apt-update G_EXEC systemctl stop motioneye - # Update systemd service to use venv - G_EXEC sed -i 's|ExecStart=/usr/local/bin/meyectl|ExecStart=/opt/motioneye/bin/meyectl|' /etc/systemd/system/motioneye.service + # Update systemd service to use venv (handle both /usr/local/bin and /usr/bin paths) + G_EXEC sed -i 's|ExecStart=.*/meyectl|ExecStart=/opt/motioneye/bin/meyectl|' /etc/systemd/system/motioneye.service # Prevent the conflicting motion daemon from starting G_EXEC systemctl --no-reload disable --now motion From b8d38a1855c9efd8d75728741808b3080886cb1f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Feb 2026 20:19:55 +0000 Subject: [PATCH 05/18] Address code review feedback: use global PYTHON_VERSION, add python3-pip, compress venv creation Co-authored-by: MichaIng <28480705+MichaIng@users.noreply.github.com> --- dietpi/dietpi-software | 65 +++++++++++++----------------------------- 1 file changed, 20 insertions(+), 45 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index bc862727e6..c3cb95930e 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -2689,7 +2689,6 @@ sudo sysctl -p /etc/sysctl.d/dietpi-$1.conf" esac shift done - unset -v PYTHON_VERSION # Install Rust if needed if (( $rust )) @@ -3149,19 +3148,19 @@ _EOF_" if To_Install 130 # Python 3 then - # Mute pip warning when running as root (which is needed to create venvs owned by specific users) + # Disable cache: It is rarely ever needed to install the very same module and version twice, hence this usually only causes unnecessary disk writes and usage. >> /etc/pip.conf G_CONFIG_INJECT '\[global\]' '[global]' /etc/pip.conf - G_CONFIG_INJECT 'root-user-action[[:blank:]]*=' 'root-user-action=ignore' /etc/pip.conf '\[global\]' - - # Disable cache: It is rarely ever needed to install the very same module and version twice, hence this usually only causes unnecessary disk writes and usage. G_CONFIG_INJECT 'no-cache-dir[[:blank:]]*=' 'no-cache-dir=true' /etc/pip.conf '\[global\]' # ARMv6/7: Add piwheels (( $G_HW_ARCH < 3 )) && G_CONFIG_INJECT 'extra-index-url[[:blank:]]*=' 'extra-index-url=https://www.piwheels.org/simple/' /etc/pip.conf '\[global\]' - # Install python3-venv for virtual environment support - aDEPS=('python3-dev' 'python3-venv') + # Install python3-venv for virtual environment support and python3-pip for system-level pip access + aDEPS=('python3-dev' 'python3-venv' 'python3-pip') + + # Obtain Python version as global variable for use in venv creation and Python_Deps + PYTHON_VERSION=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")') fi if To_Install 150 # Mono: https://www.mono-project.com/download/stable/#download-lin-debian @@ -4088,16 +4087,12 @@ sudo sysctl -p /etc/sysctl.d/98-dietpi-redis.conf' Create_User -d /mnt/dietpi_userdata/synapse synapse # Create or recreate venv if Python version changed - local python_version=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")') if [[ -f '/opt/synapse/bin/python3' ]] then local venv_version=$(/opt/synapse/bin/python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2> /dev/null) - [[ $venv_version == "$python_version" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $python_version"; G_EXEC rm -R /opt/synapse; } - fi - if [[ ! -d '/opt/synapse' ]] - then - G_EXEC python3 -m venv --system-site-packages /opt/synapse + [[ $venv_version == "$PYTHON_VERSION" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $PYTHON_VERSION"; G_EXEC rm -R /opt/synapse; } fi + [[ -d '/opt/synapse' ]] || G_EXEC python3 -m venv --system-site-packages /opt/synapse # Install into venv G_EXEC_OUTPUT=1 G_EXEC /opt/synapse/bin/pip3 install -U matrix-synapse psycopg2 @@ -5157,7 +5152,7 @@ _EOF_ elif msg.type == Gst.MessageType.EOS: _EOF_ # Install additional Python modules with --break-system-packages as Mopidy itself is an APT package - G_EXEC_OUTPUT=1 G_EXEC pip3 install --break-system-packages -U Mopidy-MusicBox-Webclient + G_EXEC_OUTPUT=1 G_EXEC pip3 install --break-system-packages --root-user-action=ignore -U Mopidy-MusicBox-Webclient # Assure user home, data and cache dir as well on custom configs G_CONFIG_INJECT 'data_dir[[:blank:]]*=' 'data_dir = /mnt/dietpi_userdata/mopidy/data' /etc/mopidy/mopidy.conf '\[core\]' @@ -9007,16 +9002,12 @@ _EOF_ (( $G_HW_MODEL > 9 )) || /boot/dietpi/func/dietpi-set_hardware rpi-camera 1 # Create or recreate venv if Python version changed - local python_version=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")') if [[ -f '/opt/motioneye/bin/python3' ]] then local venv_version=$(/opt/motioneye/bin/python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2> /dev/null) - [[ $venv_version == "$python_version" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $python_version"; G_EXEC rm -R /opt/motioneye; } - fi - if [[ ! -d '/opt/motioneye' ]] - then - G_EXEC python3 -m venv --system-site-packages /opt/motioneye + [[ $venv_version == "$PYTHON_VERSION" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $PYTHON_VERSION"; G_EXEC rm -R /opt/motioneye; } fi + [[ -d '/opt/motioneye' ]] || G_EXEC python3 -m venv --system-site-packages /opt/motioneye # Install into venv G_EXEC_OUTPUT=1 G_EXEC /opt/motioneye/bin/pip3 install -U motioneye @@ -9161,16 +9152,12 @@ _EOF_ G_EXEC mv sabnzbd-master /etc/sabnzbd # Create or recreate venv if Python version changed - local python_version=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")') if [[ -f '/opt/sabnzbd/bin/python3' ]] then local venv_version=$(/opt/sabnzbd/bin/python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2> /dev/null) - [[ $venv_version == "$python_version" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $python_version"; G_EXEC rm -R /opt/sabnzbd; } - fi - if [[ ! -d '/opt/sabnzbd' ]] - then - G_EXEC python3 -m venv --system-site-packages /opt/sabnzbd + [[ $venv_version == "$PYTHON_VERSION" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $PYTHON_VERSION"; G_EXEC rm -R /opt/sabnzbd; } fi + [[ -d '/opt/sabnzbd' ]] || G_EXEC python3 -m venv --system-site-packages /opt/sabnzbd # Python deps G_EXEC cd /etc/sabnzbd @@ -9688,16 +9675,12 @@ _EOF_ G_EXEC mv bazarr /opt # Create or recreate venv if Python version changed - local python_version=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")') if [[ -f '/opt/bazarr/venv/bin/python3' ]] then local venv_version=$(/opt/bazarr/venv/bin/python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2> /dev/null) - [[ $venv_version == "$python_version" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $python_version"; G_EXEC rm -R /opt/bazarr/venv; } - fi - if [[ ! -d '/opt/bazarr/venv' ]] - then - G_EXEC python3 -m venv --system-site-packages /opt/bazarr/venv + [[ $venv_version == "$PYTHON_VERSION" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $PYTHON_VERSION"; G_EXEC rm -R /opt/bazarr/venv; } fi + [[ -d '/opt/bazarr/venv' ]] || G_EXEC python3 -m venv --system-site-packages /opt/bazarr/venv # Python deps # - Allow Pillow to be compiled @@ -10107,16 +10090,12 @@ _EOF_ # Python deps # Create or recreate venv if Python version changed - local python_version=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")') if [[ -f '/opt/htpc-manager/bin/python3' ]] then local venv_version=$(/opt/htpc-manager/bin/python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2> /dev/null) - [[ $venv_version == "$python_version" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $python_version"; G_EXEC rm -R /opt/htpc-manager; } - fi - if [[ ! -d '/opt/htpc-manager' ]] - then - G_EXEC python3 -m venv --system-site-packages /opt/htpc-manager + [[ $venv_version == "$PYTHON_VERSION" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $PYTHON_VERSION"; G_EXEC rm -R /opt/htpc-manager; } fi + [[ -d '/opt/htpc-manager' ]] || G_EXEC python3 -m venv --system-site-packages /opt/htpc-manager G_EXEC_OUTPUT=1 G_EXEC /opt/htpc-manager/bin/pip3 install -Ur requirements.txt # Service @@ -10149,16 +10128,12 @@ _EOF_ [[ -d '/mnt/dietpi_userdata/octoprint/.cache' ]] && G_EXEC rm -R /mnt/dietpi_userdata/octoprint/.cache # Create or recreate venv if Python version changed, owned by octoprint user - local python_version=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")') if [[ -f '/mnt/dietpi_userdata/octoprint/venv/bin/python3' ]] then local venv_version=$(/mnt/dietpi_userdata/octoprint/venv/bin/python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2> /dev/null) - [[ $venv_version == "$python_version" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $python_version"; G_EXEC rm -R /mnt/dietpi_userdata/octoprint/venv; } - fi - if [[ ! -d '/mnt/dietpi_userdata/octoprint/venv' ]] - then - G_EXEC runuser -u octoprint -- python3 -m venv --system-site-packages /mnt/dietpi_userdata/octoprint/venv + [[ $venv_version == "$PYTHON_VERSION" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $PYTHON_VERSION"; G_EXEC rm -R /mnt/dietpi_userdata/octoprint/venv; } fi + [[ -d '/mnt/dietpi_userdata/octoprint/venv' ]] || G_EXEC runuser -u octoprint -- python3 -m venv --system-site-packages /mnt/dietpi_userdata/octoprint/venv # Install OctoPrint # shellcheck disable=SC2016 @@ -11727,7 +11702,7 @@ _EOF_ G_EXEC touch app.adsb.feeder.image # get the Python modules with --break-system-packages as ADS-B services control their own Python environment - G_EXEC_OUTPUT=1 G_EXEC pip3 install --break-system-packages -U flask requests + G_EXEC_OUTPUT=1 G_EXEC pip3 install --break-system-packages --root-user-action=ignore -U flask requests # finally ensure that /run allows executables (this is needed for the containers to be able to not do excessive # writes to physical storage - which might be an SD card) From c40253d19615509b41fe72f9280b7336408c76d4 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 17 Feb 2026 21:44:21 +0100 Subject: [PATCH 06/18] dietpi-software: Python 3: do actually install Python --- dietpi/dietpi-software | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index c3cb95930e..2c4deeb690 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3148,6 +3148,9 @@ _EOF_" if To_Install 130 # Python 3 then + # Install python3-venv for virtual environment support and python3-pip for system-level pip access + G_AGI python3-{dev,venv,pip} + # Disable cache: It is rarely ever needed to install the very same module and version twice, hence this usually only causes unnecessary disk writes and usage. >> /etc/pip.conf G_CONFIG_INJECT '\[global\]' '[global]' /etc/pip.conf @@ -3156,9 +3159,6 @@ _EOF_" # ARMv6/7: Add piwheels (( $G_HW_ARCH < 3 )) && G_CONFIG_INJECT 'extra-index-url[[:blank:]]*=' 'extra-index-url=https://www.piwheels.org/simple/' /etc/pip.conf '\[global\]' - # Install python3-venv for virtual environment support and python3-pip for system-level pip access - aDEPS=('python3-dev' 'python3-venv' 'python3-pip') - # Obtain Python version as global variable for use in venv creation and Python_Deps PYTHON_VERSION=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")') fi From 8e10eb7b611fbd9910111f361f36eb243a205c12 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 17 Feb 2026 22:01:14 +0100 Subject: [PATCH 07/18] dietpi-software: derive local python_version from global PYTHON_VERSION in Python_Deps Python_Deps changes the format of the variable, but it must not change the global PYTHON_VERSION format. Check and error out if PYTHON_VERSION is not set. --- dietpi/dietpi-software | 40 ++++++++++++++++------------------------ 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 2c4deeb690..a7b603159f 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -2589,26 +2589,18 @@ sudo sysctl -p /etc/sysctl.d/dietpi-$1.conf" # pyenv Add APT dependencies needed to compile Python for pyenv # Add APT dependencies needed to compile and in case run the named module # Environment variables: - # PYTHON_VERSION Python version in case e.g. pyenv is used + # PYTHON_VERSION Python version (required) Python_Deps() { - local install=0 user rust=0 piwheels=0 - - if [[ $PYTHON_VERSION ]] - then - until [[ $PYTHON_VERSION =~ ^3\.[0-9]+$ ]]; do PYTHON_VERSION=${PYTHON_VERSION%\.*}; done - else - case $G_DISTRO in - 7) PYTHON_VERSION='3.11';; - *) PYTHON_VERSION='3.13';; - esac - fi - PYTHON_VERSION=${PYTHON_VERSION/.} # so we can check in bash arithmetic + local install=0 user rust=0 piwheels=0 python_version=$PYTHON_VERSION + [[ $python_version =~ ^3(\.[0-9]+)+$ ]] || { G_DIETPI-NOTIFY 1 'PYTHON_VERSION is not or falsely set, this should never happen, please report to https://github.com/MichaIng/DietPi/issues. Aborting ...'; exit 1; } + until [[ $python_version =~ ^3\.[0-9]+$ ]]; do python_version=${python_version%\.*}; done + python_version=${python_version/.} # so we can check in bash arithmetic # Can piwheels be used? The Python version needs to match the Debian version, else dynamically linked shared libraries may not match! if (( $G_HW_ARCH < 3 )) then - if (( ( $G_DISTRO == 7 && $PYTHON_VERSION == 311 ) || ( $G_DISTRO > 7 && $PYTHON_VERSION == 313 ) )) + if (( ( $G_DISTRO == 7 && $python_version == 311 ) || ( $G_DISTRO > 7 && $python_version == 313 ) )) then piwheels=1 fi @@ -2622,10 +2614,10 @@ sudo sysctl -p /etc/sysctl.d/dietpi-$1.conf" '--user'|'-u') shift; user=$1;; '--rust'|'-r') rust=1;; '--no-piwheels'|'-P') piwheels=0;; - 'av') (( $G_HW_ARCH == 11 || ( $G_HW_ARCH < 3 && $PYTHON_VERSION != 313 ) )) && aDEPS+=('libavdevice-dev');; + 'av') (( $G_HW_ARCH == 11 || ( $G_HW_ARCH < 3 && $python_version != 313 ) )) && aDEPS+=('libavdevice-dev');; 'bcrypt') (( $G_HW_ARCH == 11 || ( $G_HW_ARCH == 1 && ! $piwheels ) )) && rust=1;; 'brotli'|'sabctools'|'ujson') (( $G_HW_ARCH == 11 || ( $G_HW_ARCH < 3 && ! $piwheels ) )) && aDEPS+=('g++');; - 'cffi') (( $G_HW_ARCH == 11 || ( $G_HW_ARCH < 3 && $PYTHON_VERSION != 311 ) )) && aDEPS+=('gcc' 'libffi-dev');; + 'cffi') (( $G_HW_ARCH == 11 || ( $G_HW_ARCH < 3 && $python_version != 311 ) )) && aDEPS+=('gcc' 'libffi-dev');; 'cryptography') if (( $G_HW_ARCH == 11 || ( $G_HW_ARCH == 1 && ! $piwheels ) )) then @@ -2634,11 +2626,11 @@ sudo sysctl -p /etc/sysctl.d/dietpi-$1.conf" fi set -- "$@" cffi ;; - 'greenlet113') (( $PYTHON_VERSION > 311 || $G_HW_ARCH == 11 || ( $G_HW_ARCH < 3 && ! $piwheels ) )) && aDEPS+=('g++');; + 'greenlet113') (( $python_version > 311 || $G_HW_ARCH == 11 || ( $G_HW_ARCH < 3 && ! $piwheels ) )) && aDEPS+=('g++');; 'libsass') (( $G_HW_ARCH == 10 || $piwheels )) || aDEPS+=('g++');; - 'lxml') (( $G_HW_ARCH == 1 && ( ! $piwheels || $PYTHON_VERSION == 313 ) )) && aDEPS+=('libxslt1-dev');; - 'matrix-synapse') (( $PYTHON_VERSION > 311 || $G_HW_ARCH == 11 || ( $G_HW_ARCH < 3 && ! $piwheels ) )) && rust=1;; - 'netifaces') (( $piwheels || ( $G_HW_ARCH == 10 && $PYTHON_VERSION <= 39 ) )) || aDEPS+=('gcc');; + 'lxml') (( $G_HW_ARCH == 1 && ( ! $piwheels || $python_version == 313 ) )) && aDEPS+=('libxslt1-dev');; + 'matrix-synapse') (( $python_version > 311 || $G_HW_ARCH == 11 || ( $G_HW_ARCH < 3 && ! $piwheels ) )) && rust=1;; + 'netifaces') (( $piwheels || ( $G_HW_ARCH == 10 && $python_version <= 39 ) )) || aDEPS+=('gcc');; 'numpy') if (( $G_HW_ARCH == 11 || ( $G_HW_ARCH == 1 && ! $piwheels ) )) then @@ -2653,8 +2645,8 @@ sudo sysctl -p /etc/sysctl.d/dietpi-$1.conf" fi ;; 'pillow') - (( $G_HW_ARCH == 11 || ( $G_HW_ARCH < 3 && ( ! $piwheels || $PYTHON_VERSION == 39 ) ) )) && aDEPS+=('gcc' 'libjpeg62-turbo-dev') - if (( $piwheels && $PYTHON_VERSION != 39 )) + (( $G_HW_ARCH == 11 || ( $G_HW_ARCH < 3 && ( ! $piwheels || $python_version == 39 ) ) )) && aDEPS+=('gcc' 'libjpeg62-turbo-dev') + if (( $piwheels && $python_version != 39 )) then aDEPS+=('libopenjp2-7' 'libtiff6' 'libxcb1') fi @@ -2664,7 +2656,7 @@ sudo sysctl -p /etc/sysctl.d/dietpi-$1.conf" set -- "$@" cryptography ;; 'psutil') (( $G_HW_ARCH < 3 || $G_HW_ARCH == 11 )) && aDEPS+=('gcc');; - 'psycopg2') (( $piwheels && $PYTHON_VERSION != 39 )) || aDEPS+=('gcc' 'libpq-dev');; + 'psycopg2') (( $piwheels && $python_version != 39 )) || aDEPS+=('gcc' 'libpq-dev');; 'pycares') (( $G_HW_ARCH == 11 || ( $G_HW_ARCH < 3 && ! $piwheels ) )) && aDEPS+=('cmake');; 'pycurl') (( $G_HW_ARCH == 11 || ( $G_HW_ARCH < 3 && ! $piwheels ) )) && aDEPS+=('gcc' 'libcurl4-openssl-dev' 'libssl-dev');; 'pydantic') @@ -2677,7 +2669,7 @@ sudo sysctl -p /etc/sysctl.d/dietpi-$1.conf" # libffi-dev for the optional _ctypes module, needed at least for Home Assistant => include it in all pyenv builds to avoid surprises aDEPS+=('gcc' 'libc6-dev' 'make' 'libssl-dev' 'zlib1g-dev' 'libbz2-dev' 'libreadline-dev' 'libsqlite3-dev' 'liblzma-dev' 'libffi-dev') # Python < 3.12: https://dietpi.com/forum/t/24975/2 - (( $PYTHON_VERSION < 312 )) && aDEPS+=('patch') + (( $python_version < 312 )) && aDEPS+=('patch') ;; 'pymicro-vad') aDEPS+=('g++');; 'pynacl') From fb1762ac6118a013ed0d67ef171b61829de1d198 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 17 Feb 2026 23:30:32 +0100 Subject: [PATCH 08/18] dietpi-software: OctoPrint: update all executable paths --- dietpi/dietpi-software | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index a7b603159f..62de1fbc6c 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -9076,9 +9076,9 @@ _EOF_ if [[ ${aSOFTWARE_INSTALL_STATE[153]} == 2 && -f '/mnt/dietpi_userdata/octoprint/.octoprint/config.yaml' ]] then G_DIETPI-NOTIFY 2 'Configuring OctoPrint to use mjpg-streamer for webcam support' - G_EXEC runuser -u octoprint -- /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set webcam.stream "http://$(G_GET_NET ip):8082/?action=stream" - G_EXEC runuser -u octoprint -- /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set webcam.snapshot 'http://127.0.0.1:8082/?action=snapshot' - G_EXEC runuser -u octoprint -- /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set webcam.ffmpeg "$(command -v ffmpeg)" + G_EXEC runuser -u octoprint -- /mnt/dietpi_userdata/octoprint/venv/bin/octoprint config set webcam.stream "http://$(G_GET_NET ip):8082/?action=stream" + G_EXEC runuser -u octoprint -- /mnt/dietpi_userdata/octoprint/venv/bin/octoprint config set webcam.snapshot 'http://127.0.0.1:8082/?action=snapshot' + G_EXEC runuser -u octoprint -- /mnt/dietpi_userdata/octoprint/venv/bin/octoprint config set webcam.ffmpeg "$(command -v ffmpeg)" fi fi @@ -10156,17 +10156,17 @@ _EOF_ # Apply service and system commands: Allow execution via specific sudoers config, use "which" for "reboot" and "poweroff", since we create shell functions in dietpi-globals to bypass logind calls if logind is not running. # shellcheck disable=SC2230 echo "octoprint ALL=NOPASSWD: $(command -v systemctl) restart octoprint, $(which reboot), $(which poweroff)" > /etc/sudoers.d/octoprint - G_EXEC runuser -u octoprint -- /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set server.commands.serverRestartCommand 'sudo systemctl restart octoprint' - G_EXEC runuser -u octoprint -- /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set server.commands.systemRestartCommand 'sudo reboot' - G_EXEC runuser -u octoprint -- /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set server.commands.systemShutdownCommand 'sudo poweroff' + G_EXEC runuser -u octoprint -- /mnt/dietpi_userdata/octoprint/venv/bin/octoprint config set server.commands.serverRestartCommand 'sudo systemctl restart octoprint' + G_EXEC runuser -u octoprint -- /mnt/dietpi_userdata/octoprint/venv/bin/octoprint config set server.commands.systemRestartCommand 'sudo reboot' + G_EXEC runuser -u octoprint -- /mnt/dietpi_userdata/octoprint/venv/bin/octoprint config set server.commands.systemShutdownCommand 'sudo poweroff' # mjpg-streamer: Configure OctoPrint to use it if installed if (( ${aSOFTWARE_INSTALL_STATE[137]} > 0 )) then G_DIETPI-NOTIFY 2 'Configuring OctoPrint to use mjpg-streamer for webcam support' - G_EXEC runuser -u octoprint -- /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set webcam.stream "http://$(G_GET_NET ip):8082/?action=stream" - G_EXEC runuser -u octoprint -- /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set webcam.snapshot 'http://127.0.0.1:8082/?action=snapshot' - G_EXEC runuser -u octoprint -- /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set webcam.ffmpeg "$(command -v ffmpeg)" + G_EXEC runuser -u octoprint -- /mnt/dietpi_userdata/octoprint/venv/bin/octoprint config set webcam.stream "http://$(G_GET_NET ip):8082/?action=stream" + G_EXEC runuser -u octoprint -- /mnt/dietpi_userdata/octoprint/venv/bin/octoprint config set webcam.snapshot 'http://127.0.0.1:8082/?action=snapshot' + G_EXEC runuser -u octoprint -- /mnt/dietpi_userdata/octoprint/venv/bin/octoprint config set webcam.ffmpeg "$(command -v ffmpeg)" fi fi From 765b0ce020e34764b10c7d11a43a9b5251d4fb2b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 18 Feb 2026 00:30:36 +0100 Subject: [PATCH 09/18] dietpi-software: fix pillow dependencies for ARMv6/7 Latest piwheels Python 3.13 pillow build failed. Remove Python 3.9 checks. --- dietpi/dietpi-software | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 62de1fbc6c..6e645adccb 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -2630,7 +2630,7 @@ sudo sysctl -p /etc/sysctl.d/dietpi-$1.conf" 'libsass') (( $G_HW_ARCH == 10 || $piwheels )) || aDEPS+=('g++');; 'lxml') (( $G_HW_ARCH == 1 && ( ! $piwheels || $python_version == 313 ) )) && aDEPS+=('libxslt1-dev');; 'matrix-synapse') (( $python_version > 311 || $G_HW_ARCH == 11 || ( $G_HW_ARCH < 3 && ! $piwheels ) )) && rust=1;; - 'netifaces') (( $piwheels || ( $G_HW_ARCH == 10 && $python_version <= 39 ) )) || aDEPS+=('gcc');; + 'netifaces') (( $piwheels )) || aDEPS+=('gcc');; 'numpy') if (( $G_HW_ARCH == 11 || ( $G_HW_ARCH == 1 && ! $piwheels ) )) then @@ -2645,8 +2645,8 @@ sudo sysctl -p /etc/sysctl.d/dietpi-$1.conf" fi ;; 'pillow') - (( $G_HW_ARCH == 11 || ( $G_HW_ARCH < 3 && ( ! $piwheels || $python_version == 39 ) ) )) && aDEPS+=('gcc' 'libjpeg62-turbo-dev') - if (( $piwheels && $python_version != 39 )) + (( $G_HW_ARCH == 11 || ( $G_HW_ARCH < 3 && ( ! $piwheels || $python_version != 311 ) ) )) && aDEPS+=('gcc' 'libjpeg62-turbo-dev') + if (( $piwheels && $python_version == 311 )) then aDEPS+=('libopenjp2-7' 'libtiff6' 'libxcb1') fi @@ -2656,7 +2656,7 @@ sudo sysctl -p /etc/sysctl.d/dietpi-$1.conf" set -- "$@" cryptography ;; 'psutil') (( $G_HW_ARCH < 3 || $G_HW_ARCH == 11 )) && aDEPS+=('gcc');; - 'psycopg2') (( $piwheels && $python_version != 39 )) || aDEPS+=('gcc' 'libpq-dev');; + 'psycopg2') (( $piwheels )) || aDEPS+=('gcc' 'libpq-dev');; 'pycares') (( $G_HW_ARCH == 11 || ( $G_HW_ARCH < 3 && ! $piwheels ) )) && aDEPS+=('cmake');; 'pycurl') (( $G_HW_ARCH == 11 || ( $G_HW_ARCH < 3 && ! $piwheels ) )) && aDEPS+=('gcc' 'libcurl4-openssl-dev' 'libssl-dev');; 'pydantic') From a90e924655f20c49e87e4a63c5572db80112f19d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 18 Feb 2026 14:06:53 +0100 Subject: [PATCH 10/18] dietpi-software: apply temporary workarounds for external bugs --- dietpi/dietpi-software | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 6e645adccb..6648cdd48e 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -2623,6 +2623,8 @@ sudo sysctl -p /etc/sysctl.d/dietpi-$1.conf" then aDEPS+=('pkg-config' 'libssl-dev') rust=1 + # Temporary workaround for maturin bug on riscv64: https://github.com/PyO3/maturin/pull/3009 + (( $G_HW_ARCH == 11 )) && export PIP_NO_BINARY='maturin' fi set -- "$@" cffi ;; @@ -5111,6 +5113,9 @@ _EOF_ G_AGI mopidy gstreamer1.0-alsa mopidy-local "${deps[@]}" G_EXEC systemctl stop mopidy + # Temporary fix for Debian package: https://salsa.debian.org/python-team/packages/mopidy/-/merge_requests/3 + [[ -e '/usr/bin/mopidy' ]] || G_EXEC ln -s /usr/share/mopidy/mopidy-cmd /usr/bin/mopidy + (( $G_DISTRO == 8 )) && ! grep -q '_get_structure_name' /lib/python3/dist-packages/mopidy/audio/scan.py && G_EXEC patch -d/ -p0 << '_EOF_' --- /lib/python3/dist-packages/mopidy/audio/scan.py +++ /lib/python3/dist-packages/mopidy/audio/scan.py From 223902b89088527d6f47f2afeb23f2ecb31a52b9 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 18 Feb 2026 17:15:57 +0100 Subject: [PATCH 11/18] dietpi-software: Python 3: install pip only on demand venv adds pip automatically, so it is not needed on system-level. Instead, install it only for the two cases where we do install further packages on system-level. Always run "python3 -m venv" even if the venv directory exists already. It might repair or refresh the venv. Add "--upgrade-deps" to upgrade pip to latest version. Bazarr: Move venv out of /opt/bazarr. That way it is preserved on reinstalls, and Bazarr does not get write access to the venv itself. It has an intenal update which might mess with unexpected files inside /opt/bazarr. HTPC Manager: minor code enhancement LazyLibrarian: remove system-level pip dependency, and venv generation and use python3 and pip3. There is still the theoretial possibility that people install Python 2 or some Python 4 in the future into that venv. Be failsafe and always use Python 3 instances explicitly. When uninstalling system-level packages via pip, pass "--break-system-packages --root-user-action=ignore" as well. --- dietpi/dietpi-software | 56 ++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 30 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 6648cdd48e..9360a0e7fe 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1689,7 +1689,7 @@ Available commands: #------------------ software_id=130 aSOFTWARE_NAME[$software_id]='Python 3' - aSOFTWARE_DESC[$software_id]='Runtime system, pip package installer and development headers' + aSOFTWARE_DESC[$software_id]='Runtime system, venv, and development headers' aSOFTWARE_CATX[$software_id]=24 aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/programming/#python-3' #------------------ @@ -3142,8 +3142,7 @@ _EOF_" if To_Install 130 # Python 3 then - # Install python3-venv for virtual environment support and python3-pip for system-level pip access - G_AGI python3-{dev,venv,pip} + G_AGI python3-{dev,venv} # Disable cache: It is rarely ever needed to install the very same module and version twice, hence this usually only causes unnecessary disk writes and usage. >> /etc/pip.conf @@ -4086,7 +4085,7 @@ sudo sysctl -p /etc/sysctl.d/98-dietpi-redis.conf' local venv_version=$(/opt/synapse/bin/python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2> /dev/null) [[ $venv_version == "$PYTHON_VERSION" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $PYTHON_VERSION"; G_EXEC rm -R /opt/synapse; } fi - [[ -d '/opt/synapse' ]] || G_EXEC python3 -m venv --system-site-packages /opt/synapse + G_EXEC python3 -m venv --upgrade-deps /opt/synapse # Install into venv G_EXEC_OUTPUT=1 G_EXEC /opt/synapse/bin/pip3 install -U matrix-synapse psycopg2 @@ -5110,7 +5109,7 @@ _EOF_ # APT package local deps=() (( $G_DISTRO == 8 )) && deps=('patch') # Trixie: Patch for Python 3.13: https://github.com/MichaIng/DietPi/issues/7866 - G_AGI mopidy gstreamer1.0-alsa mopidy-local "${deps[@]}" + G_AGI mopidy gstreamer1.0-alsa mopidy-local python3-pip "${deps[@]}" G_EXEC systemctl stop mopidy # Temporary fix for Debian package: https://salsa.debian.org/python-team/packages/mopidy/-/merge_requests/3 @@ -9004,7 +9003,7 @@ _EOF_ local venv_version=$(/opt/motioneye/bin/python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2> /dev/null) [[ $venv_version == "$PYTHON_VERSION" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $PYTHON_VERSION"; G_EXEC rm -R /opt/motioneye; } fi - [[ -d '/opt/motioneye' ]] || G_EXEC python3 -m venv --system-site-packages /opt/motioneye + G_EXEC python3 -m venv --upgrade-deps /opt/motioneye # Install into venv G_EXEC_OUTPUT=1 G_EXEC /opt/motioneye/bin/pip3 install -U motioneye @@ -9154,7 +9153,7 @@ _EOF_ local venv_version=$(/opt/sabnzbd/bin/python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2> /dev/null) [[ $venv_version == "$PYTHON_VERSION" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $PYTHON_VERSION"; G_EXEC rm -R /opt/sabnzbd; } fi - [[ -d '/opt/sabnzbd' ]] || G_EXEC python3 -m venv --system-site-packages /opt/sabnzbd + G_EXEC python3 -m venv --upgrade-deps /opt/sabnzbd # Python deps G_EXEC cd /etc/sabnzbd @@ -9672,17 +9671,17 @@ _EOF_ G_EXEC mv bazarr /opt # Create or recreate venv if Python version changed - if [[ -f '/opt/bazarr/venv/bin/python3' ]] + if [[ -f '/opt/bazarr_venv/bin/python3' ]] then - local venv_version=$(/opt/bazarr/venv/bin/python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2> /dev/null) - [[ $venv_version == "$PYTHON_VERSION" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $PYTHON_VERSION"; G_EXEC rm -R /opt/bazarr/venv; } + local venv_version=$(/opt/bazarr_venv/bin/python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2> /dev/null) + [[ $venv_version == "$PYTHON_VERSION" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $PYTHON_VERSION"; G_EXEC rm -R /opt/bazarr_venv; } fi - [[ -d '/opt/bazarr/venv' ]] || G_EXEC python3 -m venv --system-site-packages /opt/bazarr/venv + G_EXEC python3 -m venv --upgrade-deps /opt/bazarr_venv # Python deps # - Allow Pillow to be compiled G_EXEC sed --follow-symlinks -i 's/ --only-binary=Pillow$//' /opt/bazarr/requirements.txt - G_EXEC_OUTPUT=1 G_EXEC /opt/bazarr/venv/bin/pip3 install -Ur /opt/bazarr/requirements.txt + G_EXEC_OUTPUT=1 G_EXEC /opt/bazarr_venv/bin/pip3 install -Ur /opt/bazarr/requirements.txt # Data dir G_EXEC mkdir -p /mnt/dietpi_userdata/bazarr @@ -9710,7 +9709,7 @@ User=bazarr UMask=002 LogsDirectory=bazarr WorkingDirectory=/mnt/dietpi_userdata/bazarr -ExecStart=/opt/bazarr/venv/bin/python3 /opt/bazarr/bazarr.py -c /mnt/dietpi_userdata/bazarr +ExecStart=/opt/bazarr_venv/bin/python3 /opt/bazarr/bazarr.py -c /mnt/dietpi_userdata/bazarr KillSignal=SIGINT TimeoutStopSec=20 @@ -10073,26 +10072,23 @@ _EOF_ G_EXEC cd /mnt/dietpi_userdata/htpc-manager G_EXEC_OUTPUT=1 G_EXEC git remote set-url origin "$url" G_EXEC_OUTPUT=1 G_EXEC git fetch --depth=1 origin - G_EXEC_OUTPUT=1 G_EXEC git reset --hard origin - G_EXEC_OUTPUT=1 G_EXEC git clean -dxfe '/userdata' else G_EXEC_OUTPUT=1 G_EXEC git clone --depth=1 "$url" G_EXEC mkdir -p /mnt/dietpi_userdata/htpc-manager G_EXEC cp -a HTPC-Manager/. /mnt/dietpi_userdata/htpc-manager/ G_EXEC rm -R HTPC-Manager G_EXEC cd /mnt/dietpi_userdata/htpc-manager - G_EXEC_OUTPUT=1 G_EXEC git reset --hard origin - G_EXEC_OUTPUT=1 G_EXEC git clean -dxfe '/userdata' fi + G_EXEC_OUTPUT=1 G_EXEC git reset --hard origin + G_EXEC_OUTPUT=1 G_EXEC git clean -dxfe '/userdata' - # Python deps - # Create or recreate venv if Python version changed + # Python deps: Create or recreate venv if Python version changed if [[ -f '/opt/htpc-manager/bin/python3' ]] then local venv_version=$(/opt/htpc-manager/bin/python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2> /dev/null) [[ $venv_version == "$PYTHON_VERSION" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $PYTHON_VERSION"; G_EXEC rm -R /opt/htpc-manager; } fi - [[ -d '/opt/htpc-manager' ]] || G_EXEC python3 -m venv --system-site-packages /opt/htpc-manager + G_EXEC python3 -m venv --upgrade-deps /opt/htpc-manager G_EXEC_OUTPUT=1 G_EXEC /opt/htpc-manager/bin/pip3 install -Ur requirements.txt # Service @@ -10130,7 +10126,7 @@ _EOF_ local venv_version=$(/mnt/dietpi_userdata/octoprint/venv/bin/python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2> /dev/null) [[ $venv_version == "$PYTHON_VERSION" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $PYTHON_VERSION"; G_EXEC rm -R /mnt/dietpi_userdata/octoprint/venv; } fi - [[ -d '/mnt/dietpi_userdata/octoprint/venv' ]] || G_EXEC runuser -u octoprint -- python3 -m venv --system-site-packages /mnt/dietpi_userdata/octoprint/venv + G_EXEC runuser -u octoprint -- python3 -m venv --upgrade-deps /mnt/dietpi_userdata/octoprint/venv # Install OctoPrint # shellcheck disable=SC2016 @@ -11662,6 +11658,7 @@ _EOF_ if To_Install 141 adsb-setup adsb-docker # ADS-B Feeder then Python_Deps cryptography + aDEPS+=('python3-pip') # clone the adsb-feeder repo into /tmp G_EXEC_OUTPUT=1 G_EXEC git clone -b dietpi 'https://github.com/dirkhh/adsb-feeder-image' /tmp/adsb-feeder @@ -11918,7 +11915,6 @@ _EOF_ if To_Install 169 lazylibrarian # LazyLibrarian then # Dependencies - aDEPS=('python3-venv') Python_Deps cryptography pillow # Download @@ -11932,8 +11928,8 @@ _EOF_ G_EXEC mv LazyLibrarian-master /opt/lazylibrarian # Python venv - G_EXEC python3 -m venv /opt/lazylibrarian/venv - G_EXEC_OUTPUT=1 G_EXEC /opt/lazylibrarian/venv/bin/pip install /opt/lazylibrarian + G_EXEC python3 -m venv --upgrade-deps /opt/lazylibrarian/venv + G_EXEC_OUTPUT=1 G_EXEC /opt/lazylibrarian/venv/bin/pip3 install /opt/lazylibrarian # User Create_User -g dietpi lazylibrarian @@ -11972,7 +11968,7 @@ SyslogIdentifier=LazyLibrarian User=lazylibrarian UMask=002 LogsDirectory=lazylibrarian -ExecStart=/opt/lazylibrarian/venv/bin/python /opt/lazylibrarian/LazyLibrarian.py --datadir=/mnt/dietpi_userdata/lazylibrarian --nolaunch +ExecStart=/opt/lazylibrarian/venv/bin/python3 /opt/lazylibrarian/LazyLibrarian.py --datadir=/mnt/dietpi_userdata/lazylibrarian --nolaunch ExitType=cgroup # Hardening @@ -12996,7 +12992,7 @@ _EOF_ if To_Uninstall 180 # Bazarr then Remove_Service bazarr 1 - G_EXEC rm -Rf /opt/bazarr /mnt/dietpi_userdata/bazarr /var/log/bazarr + G_EXEC rm -Rf /opt/bazarr_venv /opt/bazarr /mnt/dietpi_userdata/bazarr /var/log/bazarr fi if To_Uninstall 200 # DietPi-Dashboard @@ -13177,7 +13173,7 @@ _EOF_ [[ -f '/etc/apt/sources.list.d/dietpi-mopidy.list' ]] && G_EXEC rm /etc/apt/sources.list.d/dietpi-mopidy.list [[ -f '/etc/apt/trusted.gpg.d/dietpi-mopidy.gpg' ]] && G_EXEC rm /etc/apt/trusted.gpg.d/dietpi-mopidy.gpg - command -v pip3 > /dev/null && G_EXEC_OUTPUT=1 G_EXEC pip3 uninstall -y Mopidy-MusicBox-Webclient + command -v pip3 > /dev/null && G_EXEC_OUTPUT=1 G_EXEC pip3 uninstall -y --break-system-packages --root-user-action=ignore Mopidy-MusicBox-Webclient getent passwd mopidy > /dev/null && G_EXEC userdel mopidy [[ -d '/mnt/dietpi_userdata/mopidy' ]] && G_EXEC rm -R /mnt/dietpi_userdata/mopidy @@ -13907,7 +13903,7 @@ _EOF_ then G_AGP docker-compose-plugin docker-compose [[ -f '/usr/local/bin/docker-compose' ]] && G_EXEC rm /usr/local/bin/docker-compose # Pre-v8.14 - command -v docker-compose > /dev/null && command -v pip3 > /dev/null && G_EXEC_OUTPUT=1 G_EXEC pip3 uninstall -y docker-compose # Pre-v8.2 + command -v docker-compose > /dev/null && command -v pip3 > /dev/null && G_EXEC_OUTPUT=1 G_EXEC pip3 uninstall -y --break-system-packages --root-user-action=ignore docker-compose # Pre-v8.2 fi if To_Uninstall 162 # Docker @@ -14276,8 +14272,8 @@ _EOF_ if To_Uninstall 130 # Python 3 then - command -v pip3 > /dev/null && G_EXEC_OUTPUT=1 G_EXEC pip3 uninstall -y pip setuptools wheel - G_AGP python3-dev python3-pip # python3-pip: Pre-v6.32 + command -v pip3 > /dev/null && G_EXEC_OUTPUT=1 G_EXEC pip3 uninstall -y --break-system-packages --root-user-action=ignore pip setuptools wheel # Pre-v10.1 + G_AGP python3-dev python3-venv python3-pip [[ -f '/etc/pip.conf' ]] && G_EXEC rm /etc/pip.conf G_EXEC rm -Rf /{root,home/*}/.cache/pip fi From fa6ed55994b75f9a99c3b6d0065c0a40395707f7 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 18 Feb 2026 17:27:43 +0100 Subject: [PATCH 12/18] dietpi-software: minor reformatting --- dietpi/dietpi-software | 58 ++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 9360a0e7fe..67461cd190 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4076,20 +4076,19 @@ sudo sysctl -p /etc/sysctl.d/98-dietpi-redis.conf' # Dependencies Python_Deps -i bcrypt cryptography pillow psycopg2 pynacl matrix-synapse - # User - Create_User -d /mnt/dietpi_userdata/synapse synapse - - # Create or recreate venv if Python version changed + # Install + # - Create or recreate venv if Python version changed if [[ -f '/opt/synapse/bin/python3' ]] then local venv_version=$(/opt/synapse/bin/python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2> /dev/null) [[ $venv_version == "$PYTHON_VERSION" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $PYTHON_VERSION"; G_EXEC rm -R /opt/synapse; } fi G_EXEC python3 -m venv --upgrade-deps /opt/synapse - - # Install into venv G_EXEC_OUTPUT=1 G_EXEC /opt/synapse/bin/pip3 install -U matrix-synapse psycopg2 + # User + Create_User -d /mnt/dietpi_userdata/synapse synapse + # Service cat << '_EOF_' > /etc/systemd/system/synapse.service [Unit] @@ -9666,22 +9665,21 @@ _EOF_ # Download Download_Install 'https://github.com/morpheus65535/bazarr/releases/latest/download/bazarr.zip' bazarr - # Install: Remove previous instance on reinstall - [[ -d '/opt/bazarr' ]] && G_EXEC rm -R /opt/bazarr - G_EXEC mv bazarr /opt - - # Create or recreate venv if Python version changed + # Python deps + # - Create or recreate venv if Python version changed if [[ -f '/opt/bazarr_venv/bin/python3' ]] then local venv_version=$(/opt/bazarr_venv/bin/python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2> /dev/null) [[ $venv_version == "$PYTHON_VERSION" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $PYTHON_VERSION"; G_EXEC rm -R /opt/bazarr_venv; } fi G_EXEC python3 -m venv --upgrade-deps /opt/bazarr_venv - - # Python deps # - Allow Pillow to be compiled - G_EXEC sed --follow-symlinks -i 's/ --only-binary=Pillow$//' /opt/bazarr/requirements.txt - G_EXEC_OUTPUT=1 G_EXEC /opt/bazarr_venv/bin/pip3 install -Ur /opt/bazarr/requirements.txt + G_EXEC sed --follow-symlinks -i 's/ --only-binary=Pillow$//' bazarr/requirements.txt + G_EXEC_OUTPUT=1 G_EXEC /opt/bazarr_venv/bin/pip3 install -Ur bazarr/requirements.txt + + # Install: Remove previous instance on reinstall + [[ -d '/opt/bazarr' ]] && G_EXEC rm -R /opt/bazarr + G_EXEC mv bazarr /opt # Data dir G_EXEC mkdir -p /mnt/dietpi_userdata/bazarr @@ -11657,8 +11655,8 @@ _EOF_ if To_Install 141 adsb-setup adsb-docker # ADS-B Feeder then + aDEPS=('python3-pip') Python_Deps cryptography - aDEPS+=('python3-pip') # clone the adsb-feeder repo into /tmp G_EXEC_OUTPUT=1 G_EXEC git clone -b dietpi 'https://github.com/dirkhh/adsb-feeder-image' /tmp/adsb-feeder @@ -12781,8 +12779,8 @@ _EOF_ if To_Uninstall 125 # Synapse then Remove_Service synapse 1 1 - [[ -d '/mnt/dietpi_userdata/synapse' ]] && G_EXEC rm -R /mnt/dietpi_userdata/synapse - [[ -d '/opt/synapse' ]] && G_EXEC rm -R /opt/synapse + G_EXEC rm -Rf /opt/synapse + G_EXEC rm -Rf /mnt/dietpi_userdata/synapse command -v dropdb > /dev/null && runuser -u postgres -- dropdb synapse command -v dropuser > /dev/null && runuser -u postgres -- dropuser synapse @@ -12839,11 +12837,11 @@ _EOF_ if To_Uninstall 136 # motionEye then Remove_Service motioneye - [[ -d '/opt/motioneye' ]] && G_EXEC rm -R /opt/motioneye + G_EXEC rm -Rf /opt/motioneye + G_EXEC rm -Rf /etc/motioneye + G_EXEC rm -Rf /var/log/motioneye + G_EXEC rm -Rf /var/lib/motioneye G_AGP motion - [[ -d '/etc/motioneye' ]] && G_EXEC rm -R /etc/motioneye - [[ -d '/var/log/motioneye' ]] && G_EXEC rm -R /var/log/motioneye - [[ -d '/var/lib/motioneye' ]] && G_EXEC rm -R /var/lib/motioneye [[ -d '/mnt/dietpi_userdata/motioneye' ]] && G_DIETPI-NOTIFY 2 'The motionEye media directory is left in place. You can manually remove it via:\n rm -R /mnt/dietpi_userdata/motioneye' fi @@ -12872,10 +12870,10 @@ _EOF_ if To_Uninstall 139 # SABnzbd then Remove_Service sabnzbd 1 1 # group for pre-v6.33 - [[ -d '/opt/sabnzbd' ]] && G_EXEC rm -R /opt/sabnzbd - [[ -d '/etc/sabnzbd' ]] && G_EXEC rm -R /etc/sabnzbd - [[ -d '/mnt/dietpi_userdata/downloads/sabnzbd_admin' ]] && G_EXEC rm -R /mnt/dietpi_userdata/downloads/sabnzbd_admin - [[ -d '/mnt/dietpi_userdata/downloads/sabnzbd_nzb_backup' ]] && G_EXEC rm -R /mnt/dietpi_userdata/downloads/sabnzbd_nzb_backup + G_EXEC rm -Rf /opt/sabnzbd + G_EXEC rm -Rf /etc/sabnzbd + G_EXEC rm -Rf /mnt/dietpi_userdata/downloads/sabnzbd_admin + G_EXEC rm -Rf /mnt/dietpi_userdata/downloads/sabnzbd_nzb_backup [[ -d '/var/log/sabnzbd' ]] && G_EXEC rm -R /var/log/sabnzbd # Pre-v7.9 fi @@ -13050,8 +13048,8 @@ _EOF_ if To_Uninstall 155 # HTPC Manager then Remove_Service htpc-manager - [[ -d '/opt/htpc-manager' ]] && G_EXEC rm -R /opt/htpc-manager - [[ -d '/mnt/dietpi_userdata/htpc-manager' ]] && G_EXEC rm -R /mnt/dietpi_userdata/htpc-manager + G_EXEC rm -Rf /opt/htpc-manager + G_EXEC rm -Rf /mnt/dietpi_userdata/htpc-manager fi if To_Uninstall 150 # Mono @@ -14273,8 +14271,8 @@ _EOF_ if To_Uninstall 130 # Python 3 then command -v pip3 > /dev/null && G_EXEC_OUTPUT=1 G_EXEC pip3 uninstall -y --break-system-packages --root-user-action=ignore pip setuptools wheel # Pre-v10.1 - G_AGP python3-dev python3-venv python3-pip - [[ -f '/etc/pip.conf' ]] && G_EXEC rm /etc/pip.conf + G_AGP python3-{dev,venv,pip} + G_EXEC rm -f /etc/pip.conf G_EXEC rm -Rf /{root,home/*}/.cache/pip fi From a226b8417d87142249d807a497e9c52eb5e5108d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 18 Feb 2026 17:51:59 +0100 Subject: [PATCH 13/18] dietpi-software: move venv check into function --- dietpi/dietpi-software | 62 ++++++++++++++---------------------------- 1 file changed, 20 insertions(+), 42 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 67461cd190..b215d435f6 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -2707,6 +2707,16 @@ sudo sysctl -p /etc/sysctl.d/dietpi-$1.conf" aDEPS=() } + # Remove venv at $1 if Python version changed + Remove_old_venv() + { + [[ -f $1'/bin/python3' ]] || return 0 + local venv_version=$("$1/bin/python3" -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2> /dev/null) + [[ $venv_version == "$PYTHON_VERSION" ]] && return 0 + G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $PYTHON_VERSION" + G_EXEC rm -R "$1" + } + To_Install() { (( ${aSOFTWARE_INSTALL_STATE[$1]} == 1 )) || return 1 @@ -4077,12 +4087,7 @@ sudo sysctl -p /etc/sysctl.d/98-dietpi-redis.conf' Python_Deps -i bcrypt cryptography pillow psycopg2 pynacl matrix-synapse # Install - # - Create or recreate venv if Python version changed - if [[ -f '/opt/synapse/bin/python3' ]] - then - local venv_version=$(/opt/synapse/bin/python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2> /dev/null) - [[ $venv_version == "$PYTHON_VERSION" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $PYTHON_VERSION"; G_EXEC rm -R /opt/synapse; } - fi + Remove_old_venv /opt/synapse G_EXEC python3 -m venv --upgrade-deps /opt/synapse G_EXEC_OUTPUT=1 G_EXEC /opt/synapse/bin/pip3 install -U matrix-synapse psycopg2 @@ -8996,15 +9001,9 @@ _EOF_ # RPi: Enable camera module (( $G_HW_MODEL > 9 )) || /boot/dietpi/func/dietpi-set_hardware rpi-camera 1 - # Create or recreate venv if Python version changed - if [[ -f '/opt/motioneye/bin/python3' ]] - then - local venv_version=$(/opt/motioneye/bin/python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2> /dev/null) - [[ $venv_version == "$PYTHON_VERSION" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $PYTHON_VERSION"; G_EXEC rm -R /opt/motioneye; } - fi + # motionEye + Remove_old_venv /opt/motioneye G_EXEC python3 -m venv --upgrade-deps /opt/motioneye - - # Install into venv G_EXEC_OUTPUT=1 G_EXEC /opt/motioneye/bin/pip3 install -U motioneye G_EXEC_OUTPUT=1 G_EXEC /opt/motioneye/bin/motioneye_init --skip-apt-update G_EXEC systemctl stop motioneye @@ -9146,15 +9145,9 @@ _EOF_ # Install G_EXEC mv sabnzbd-master /etc/sabnzbd - # Create or recreate venv if Python version changed - if [[ -f '/opt/sabnzbd/bin/python3' ]] - then - local venv_version=$(/opt/sabnzbd/bin/python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2> /dev/null) - [[ $venv_version == "$PYTHON_VERSION" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $PYTHON_VERSION"; G_EXEC rm -R /opt/sabnzbd; } - fi - G_EXEC python3 -m venv --upgrade-deps /opt/sabnzbd - # Python deps + Remove_old_venv /opt/sabnzbd + G_EXEC python3 -m venv --upgrade-deps /opt/sabnzbd G_EXEC cd /etc/sabnzbd G_EXEC_OUTPUT=1 G_EXEC /opt/sabnzbd/bin/pip3 install -Ur requirements.txt @@ -9666,12 +9659,7 @@ _EOF_ Download_Install 'https://github.com/morpheus65535/bazarr/releases/latest/download/bazarr.zip' bazarr # Python deps - # - Create or recreate venv if Python version changed - if [[ -f '/opt/bazarr_venv/bin/python3' ]] - then - local venv_version=$(/opt/bazarr_venv/bin/python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2> /dev/null) - [[ $venv_version == "$PYTHON_VERSION" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $PYTHON_VERSION"; G_EXEC rm -R /opt/bazarr_venv; } - fi + Remove_old_venv /opt/bazarr_venv G_EXEC python3 -m venv --upgrade-deps /opt/bazarr_venv # - Allow Pillow to be compiled G_EXEC sed --follow-symlinks -i 's/ --only-binary=Pillow$//' bazarr/requirements.txt @@ -10080,12 +10068,8 @@ _EOF_ G_EXEC_OUTPUT=1 G_EXEC git reset --hard origin G_EXEC_OUTPUT=1 G_EXEC git clean -dxfe '/userdata' - # Python deps: Create or recreate venv if Python version changed - if [[ -f '/opt/htpc-manager/bin/python3' ]] - then - local venv_version=$(/opt/htpc-manager/bin/python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2> /dev/null) - [[ $venv_version == "$PYTHON_VERSION" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $PYTHON_VERSION"; G_EXEC rm -R /opt/htpc-manager; } - fi + # Python deps + Remove_old_venv /opt/htpc-manager G_EXEC python3 -m venv --upgrade-deps /opt/htpc-manager G_EXEC_OUTPUT=1 G_EXEC /opt/htpc-manager/bin/pip3 install -Ur requirements.txt @@ -10118,15 +10102,9 @@ _EOF_ # Clear pip cache in case it got somehow created [[ -d '/mnt/dietpi_userdata/octoprint/.cache' ]] && G_EXEC rm -R /mnt/dietpi_userdata/octoprint/.cache - # Create or recreate venv if Python version changed, owned by octoprint user - if [[ -f '/mnt/dietpi_userdata/octoprint/venv/bin/python3' ]] - then - local venv_version=$(/mnt/dietpi_userdata/octoprint/venv/bin/python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")' 2> /dev/null) - [[ $venv_version == "$PYTHON_VERSION" ]] || { G_DIETPI-NOTIFY 2 "Recreating venv due to Python version change: $venv_version -> $PYTHON_VERSION"; G_EXEC rm -R /mnt/dietpi_userdata/octoprint/venv; } - fi - G_EXEC runuser -u octoprint -- python3 -m venv --upgrade-deps /mnt/dietpi_userdata/octoprint/venv - # Install OctoPrint + Remove_old_venv /mnt/dietpi_userdata/octoprint/venv + G_EXEC runuser -u octoprint -- python3 -m venv --upgrade-deps /mnt/dietpi_userdata/octoprint/venv # shellcheck disable=SC2016 G_EXEC_OUTPUT=1 G_EXEC runuser -u octoprint -- dash -c 'PATH="$HOME/.cargo/bin:$PATH" /mnt/dietpi_userdata/octoprint/venv/bin/pip3 install -U octoprint' From e834e4048138b087a4edc3f5b9135caa1f07dded Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 18 Feb 2026 21:26:03 +0100 Subject: [PATCH 14/18] dietpi-patches: migrate Python software into venvs This is only done where the actual end user software itself was installed via pip. In all other cases, only dependencies were installed via pip, and there is no point to perform the migration now: we have no way to cleanup the system-site, since we cannot know which package was installed as dependency for our software options only, and which are needed for other software, possibly installed by the admin. We cannot offer a complete removal of `/usr/local/lib/python3.*/dist-packages` either, since Mopidy and ADS-B Feeder at least still require it. Once this is not the case anymore, we can offer to uninstall all packages form that site, in favour of consequent venv (or similar) usage, as modern pip makes it increasingly hard to install packages via pip on system-level, while `python3-*` modules can be installed via APT. --- .update/patches | 38 +++++++++++++++++++++++++++++++++++++- dietpi/dietpi-software | 2 -- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/.update/patches b/.update/patches index a277db0330..1c137e96f9 100755 --- a/.update/patches +++ b/.update/patches @@ -2228,7 +2228,7 @@ Patch_10_1() then G_DIETPI-NOTIFY 2 'Fixing Chromium kiosk mode' # shellcheck disable=SC2016 - G_EXEC sed --follow-symlink -i 's|"\$STARTX" chromium|"$STARTX" /usr/bin/chromium|' /var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh + G_EXEC sed --follow-symlinks -i 's|"\$STARTX" chromium|"$STARTX" /usr/bin/chromium|' /var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh fi # Orange Pi 3B @@ -2258,6 +2258,42 @@ _EOF_' # Software updates, migrations and patches if [[ -f '/boot/dietpi/.installed' ]] then + # Python software migration to venv + # - Python 3 + if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[130\]=2' /boot/dietpi/.installed && [[ -f '/etc/pip.conf' ]] + then + G_DIETPI-NOTIFY 2 'Removing obsolete pip directives now that we move all Python software into venvs' + G_EXEC sed --follow-symlinks -i '/^[[:blank:]]*break-system-packages[[:blank:]]*=/d' /etc/pip.conf + G_EXEC sed --follow-symlinks -i '/^[[:blank:]]*root-user-action[[:blank:]]*=/d' /etc/pip.conf + fi + # - Synapse + if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[125\]=2' /boot/dietpi/.installed + then + G_DIETPI-NOTIFY 2 'Removing system-level Synpase Python module and scheduling reinstall to install it into a venv' + command -v pip3 > /dev/null && G_EXEC_OUTPUT=1 G_EXEC pip3 uninstall -y --break-system-packages --root-user-action=ignore matrix-synapse + G_EXEC eval 'echo 125 >> /var/tmp/dietpi/dietpi-update_reinstalls' + fi + # - motionEye + if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[136\]=2' /boot/dietpi/.installed + then + G_DIETPI-NOTIFY 2 'Removing system-level motionEye Python module and scheduling reinstall to install it into a venv' + command -v pip3 > /dev/null && G_EXEC_OUTPUT=1 G_EXEC pip3 uninstall -y --break-system-packages --root-user-action=ignore motioneye + G_EXEC eval 'echo 136 >> /var/tmp/dietpi/dietpi-update_reinstalls' + fi + # - OctoPrint + if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[153\]=2' /boot/dietpi/.installed + then + G_DIETPI-NOTIFY 2 'Moving user-level OctoPrint Python modules into venv and scheduling reinstall' + if [[ -d '/mnt/dietpi_userdata/octoprint/.local' && ! -d '/mnt/dietpi_userdata/octoprint/venv' ]] + then + G_AGI python3-venv + G_EXEC mv /mnt/dietpi_userdata/octoprint/{.local,venv} + G_EXEC python3 -m venv /mnt/dietpi_userdata/octoprint/venv + G_EXEC find /mnt/dietpi_userdata/octoprint/venv/bin -type f -exec sed --follow-symlinks -i '1s|^#!/.*/bin/python3|#!/mnt/dietpi_userdata/octoprint/venv/bin/python3|' {} + + fi + G_EXEC eval 'echo 153 >> /var/tmp/dietpi/dietpi-update_reinstalls' + fi + # Pi-hole v6 migration # - /etc/pihole/pihole.toml indicates that Pi-hole has been upgraded to v6 already. # - The /var/www/pihole symlink indicates that an instance installed via dietpi-software has not been migrated yet. diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index b215d435f6..3b5f56eed3 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -13878,8 +13878,6 @@ _EOF_ if To_Uninstall 134 # Docker Compose then G_AGP docker-compose-plugin docker-compose - [[ -f '/usr/local/bin/docker-compose' ]] && G_EXEC rm /usr/local/bin/docker-compose # Pre-v8.14 - command -v docker-compose > /dev/null && command -v pip3 > /dev/null && G_EXEC_OUTPUT=1 G_EXEC pip3 uninstall -y --break-system-packages --root-user-action=ignore docker-compose # Pre-v8.2 fi if To_Uninstall 162 # Docker From 61c9b41260c3653b51b0ecf8cdd4b344d348d095 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 18 Feb 2026 22:10:57 +0100 Subject: [PATCH 15/18] dietpi-software: ADS-B Feeder: assure dependencies are actually installed --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 3b5f56eed3..59e56fe60e 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -11634,7 +11634,7 @@ _EOF_ if To_Install 141 adsb-setup adsb-docker # ADS-B Feeder then aDEPS=('python3-pip') - Python_Deps cryptography + Python_Deps -i cryptography # clone the adsb-feeder repo into /tmp G_EXEC_OUTPUT=1 G_EXEC git clone -b dietpi 'https://github.com/dirkhh/adsb-feeder-image' /tmp/adsb-feeder From 415d346d35c6ed5fe092b609f3f0203ef43127f9 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 18 Feb 2026 22:55:19 +0100 Subject: [PATCH 16/18] dietpi-software: ADS-B Feeder: install cryptography directly The adsb-setup.service tries it, which fails due to now missing "--break-system-packages". Also remove obsolete bash path fix. --- dietpi/dietpi-software | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 59e56fe60e..d308bf4223 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -11633,8 +11633,10 @@ _EOF_ if To_Install 141 adsb-setup adsb-docker # ADS-B Feeder then + # Python deps aDEPS=('python3-pip') Python_Deps -i cryptography + G_EXEC_OUTPUT=1 G_EXEC pip3 install --break-system-packages --root-user-action=ignore -U cryptography flask requests # clone the adsb-feeder repo into /tmp G_EXEC_OUTPUT=1 G_EXEC git clone -b dietpi 'https://github.com/dirkhh/adsb-feeder-image' /tmp/adsb-feeder @@ -11644,8 +11646,6 @@ _EOF_ G_EXEC rm ./usr/lib/systemd/system/adsb-bootstrap.service G_EXEC rm ./usr/lib/systemd/system/adsb-update.service G_EXEC rm ./usr/lib/systemd/system/adsb-update.timer - # Fix bash path on potentially non-usr-merged systems - [[ -f '/usr/bin/bash' ]] || G_EXEC sed --follow-symlinks -i 's|/usr/bin/bash|/bin/bash|' ./usr/lib/systemd/system/adsb-*.service G_EXEC mv ./usr/lib/systemd/system/* /etc/systemd/system/ # determine the version @@ -11671,9 +11671,6 @@ _EOF_ G_EXEC rm -f os.adsb.feeder.image G_EXEC touch app.adsb.feeder.image - # get the Python modules with --break-system-packages as ADS-B services control their own Python environment - G_EXEC_OUTPUT=1 G_EXEC pip3 install --break-system-packages --root-user-action=ignore -U flask requests - # finally ensure that /run allows executables (this is needed for the containers to be able to not do excessive # writes to physical storage - which might be an SD card) G_EXEC mount -o remount,exec /run From 793ccd3aa2324a9100989e30e2a8ad66dbe8d1c2 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 18 Feb 2026 23:07:53 +0100 Subject: [PATCH 17/18] changelog: add entry about Python venv migration --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c00bbd1901..07a3d94ba7 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -7,6 +7,7 @@ New images: Enhancements: - NanoPi R5C | Resolved an issue where the Ethernet network interface names could have swapped on reboots. They are now assigned with eth0 as LAN port and eth1 as WAN port. Many thanks to @firebox for reporting this issue: https://dietpi.com/forum/t/24845/24 - DietPi-Tools | DietPi-Banner: New option to output the Linux kernel version +- DietPi-Software | Python 3: All Python software options make now use of venvs, instead of being installed to the system site "/usr/local/lib/python3.*/dist-packages". Recent pip has increasing issues managing modules there on distros which have own Python module packages. Modern setups almost require isolated environments like venv. Synapse, motionEye, and OctoPrint are reinstalled on DietPi update to perform the migration directly, preserving user data and plugins. The "break-system-packages" flag in /etc/pip.conf is consequently removed. If you need to manage packages via pip at the system site, add the "--break-system-packages" CLI flag to each call. - DietPi-Software | Navidrome: Support for RISC-V has been unlocked, as official builds have been added with the v0.60.0 release on GitHub. - DietPi-Software | MinIO: The console client "mc" is now installed along with the server, to make up with the lost administration functionalities of the community server web UI. A shell alias is generated to invoke it as "minio-user" user, using a pre-generated config file /mnt/dietpi_userdata/minio-data/.mc/config.json. It adds the local MinIO server instance as "local" alias. Additionally, the default credentials have been changed to username (access key) "dietpi" and the default software password as secret key. Since MinIO requires the password to be at least 8 characters long, the default software password is concatenated until 8 characters are reached. E.g. if "test" was used, it will be "testtest" for MinIO. However, don't try it and use a secure default software password of 12 characters or more on production systems ;). Change it afterwards for the MinIO server in /etc/default/minio, and for the console client "mc" accordingly in /mnt/dietpi_userdata/minio-data/.mc/config.json. - DietPi-Software | TigerVNC/RealVNC/XRDP: Those remote desktop servers do not actually require a desktop anymore, but just the X server. This allows lighter setups when using them to show an individual GUI application like Chromium only, instead of a full desktop. Many thanks to @fow0ryl for doing this suggestion: https://github.com/MichaIng/DietPi/issues/7947 From 5c2a4d198db7961deaca7c91aaa7b5a652b3cd18 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 18 Feb 2026 23:30:39 +0100 Subject: [PATCH 18/18] dietpi-software: ADS-B Feeder: install Python modules via apt This aligns it with the generic app installer of the project: https://github.com/dirkhh/adsb-feeder-image/blob/main/src/tools/app-install.sh --- .github/workflows/dietpi-software.bash | 2 +- dietpi/dietpi-software | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dietpi-software.bash b/.github/workflows/dietpi-software.bash index 6904697820..e9e83921ad 100644 --- a/.github/workflows/dietpi-software.bash +++ b/.github/workflows/dietpi-software.bash @@ -334,7 +334,7 @@ do 61) Process_Software 60;; 125) Process_Software 194;; 86|134|185) Process_Software 162;; - 141) Process_Software 17 130 134 162;; + 141) Process_Software 17 134 162;; 166) Process_Software 70;; 180) (( $arch == 10 || $arch == 3 )) || Process_Software 170;; 188) Process_Software 17;; diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index d308bf4223..1920bab3d9 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1575,7 +1575,7 @@ Available commands: aSOFTWARE_DESC[$software_id]='track airplanes using SDRs and feed the data to ADS-B aggregators' aSOFTWARE_CATX[$software_id]=19 aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/distributed_projects/#adsb-feeder' - aSOFTWARE_DEPS[$software_id]='17 130 134 162' # Git, Python, Docker & Docker Compose + aSOFTWARE_DEPS[$software_id]='17 134 162' # Git, Docker & Docker Compose #------------------ software_id=184 aSOFTWARE_NAME[$software_id]='Tor Relay' @@ -11633,10 +11633,8 @@ _EOF_ if To_Install 141 adsb-setup adsb-docker # ADS-B Feeder then - # Python deps - aDEPS=('python3-pip') - Python_Deps -i cryptography - G_EXEC_OUTPUT=1 G_EXEC pip3 install --break-system-packages --root-user-action=ignore -U cryptography flask requests + # Deps + G_AGI python3-{cryptography,flask,requests} # clone the adsb-feeder repo into /tmp G_EXEC_OUTPUT=1 G_EXEC git clone -b dietpi 'https://github.com/dirkhh/adsb-feeder-image' /tmp/adsb-feeder