feat: Kali upgrade python3.13

linuztx committed Sep 11, 2025 at 12:10 UTC 33618bc030b44d8a93ed9e42ad7ce2d6f79c64f7
6 files changed +59 -22
docker/base/Dockerfile
+3
@@ -24,6 +24,9 @@ RUN bash /ins/install_base_packages2.sh
24 RUN bash /ins/install_base_packages3.sh
25 RUN bash /ins/install_base_packages4.sh
26
27 +# install pyenv
28 +RUN bash /ins/install_pyenv.sh
29 +
30 # install python after packages to ensure version overriding
31 RUN bash /ins/install_python.sh
32
docker/base/fs/ins/install_pyenv.sh new
+34
@@ -0,0 +1,34 @@
1 +#!/bin/bash
2 +set -e
3 +
4 +echo "====================PYENV START===================="
5 +
6 +# Install pyenv build dependencies.
7 +apt-get install -y --no-install-recommends \
8 + make build-essential libssl-dev zlib1g-dev libbz2-dev \
9 + libreadline-dev libsqlite3-dev wget curl llvm \
10 + libncursesw5-dev xz-utils tk-dev libxml2-dev \
11 + libxmlsec1-dev libffi-dev liblzma-dev
12 +
13 +# Install pyenv for root user
14 +git clone https://github.com/pyenv/pyenv.git /root/.pyenv
15 +
16 +# Setup environment variables for pyenv to be available system-wide
17 +cat > /etc/profile.d/pyenv.sh <<'EOF'
18 +export PYENV_ROOT="/root/.pyenv"
19 +export PATH="$PYENV_ROOT/bin:$PATH"
20 +eval "$(pyenv init --path)"
21 +EOF
22 +
23 +chmod +x /etc/profile.d/pyenv.sh
24 +
25 +# Source pyenv environment to make it available in this script
26 +source /etc/profile.d/pyenv.sh
27 +
28 +# Install Python 3.12.4
29 +echo "====================PYENV INSTALLING PYTHON 3.12.4===================="
30 +pyenv install 3.12.4
31 +
32 +/root/.pyenv/versions/3.12.4/bin/python -m venv /opt/venv-a0
33 +
34 +echo "====================PYENV END===================="
\ No newline at end of file
docker/base/fs/ins/install_python.sh
+17 -17
@@ -8,26 +8,26 @@ echo "====================PYTHON 3.12 & SID REPO===================="
8 apt clean
9
10 # ★ 1. Add sid repo & pin it for python 3.12
11 -echo "deb http://deb.debian.org/debian sid main" > /etc/apt/sources.list.d/debian-sid.list
12 -cat >/etc/apt/preferences.d/python312 <<'EOF'
13 -Package: *
14 -Pin: release a=sid
15 -Pin-Priority: 100
16 -
17 -Package: python3.12*
18 -Pin: release a=sid
19 -Pin-Priority: 990
20 -
21 -# Prevent Python 3.13 from being installed
22 -Package: python3.13*
23 -Pin: release *
24 -Pin-Priority: -1
25 -EOF
11 +# echo "deb http://deb.debian.org/debian sid main" > /etc/apt/sources.list.d/debian-sid.list
12 +# cat >/etc/apt/preferences.d/python312 <<'EOF'
13 +# Package: *
14 +# Pin: release a=sid
15 +# Pin-Priority: 100
16 +
17 +# Package: python3.12*
18 +# Pin: release a=sid
19 +# Pin-Priority: 990
20 +
21 +# # Prevent Python 3.13 from being installed
22 +# Package: python3.13*
23 +# Pin: release *
24 +# Pin-Priority: -1
25 +# EOF
26
27 apt-get update && apt-get -y upgrade
28
29 apt-get install -y --no-install-recommends \
30 - python3.12 python3.12-venv python3.12-dev
30 + python3.13 python3.13-venv python3.13-dev
31
32 # ★ 3. Switch the interpreter
33 # update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.13 0
@@ -40,7 +40,7 @@ echo "====================PYTHON OTHERS: $(ls /usr/bin/python*) "
40 echo "====================PYTHON VENV===================="
41
42 # create and activate default venv
43 -python3.12 -m venv /opt/venv
43 +python3.13 -m venv /opt/venv
44 source /opt/venv/bin/activate
45
46 # upgrade pip and install static packages
docker/base/fs/ins/install_searxng.sh
-1
@@ -5,7 +5,6 @@ echo "====================SEARXNG1 START===================="
5
6 # Install necessary packages
7 apt-get install -y \
8 - python3.12-dev python3.12-venv \
8 git build-essential libxslt-dev zlib1g-dev libffi-dev libssl-dev
9 # python3.12-babel uwsgi uwsgi-plugin-python3
10
docker/base/fs/ins/install_searxng2.sh
+2 -2
@@ -11,7 +11,7 @@ git clone "https://github.com/searxng/searxng" \
11 echo "====================SEARXNG2 VENV===================="
12
13 # create virtualenv:
14 -python3.12 -m venv "/usr/local/searxng/searx-pyenv"
14 +python3.13 -m venv "/usr/local/searxng/searx-pyenv"
15
16 # make it default
17 echo ". /usr/local/searxng/searx-pyenv/bin/activate" \
@@ -23,7 +23,7 @@ source "/usr/local/searxng/searx-pyenv/bin/activate"
23 echo "====================SEARXNG2 INST===================="
24
25 # update pip's boilerplate
26 -pip install --no-cache-dir -U pip setuptools wheel pyyaml
26 +pip install --no-cache-dir -U pip setuptools wheel pyyaml lxml
27
28 # jump to SearXNG's working tree and install SearXNG into virtualenv
29 cd "/usr/local/searxng/searxng-src"
docker/run/fs/ins/setup_venv.sh
+3 -2
@@ -7,5 +7,6 @@ set -e
7 # python3.12 -m venv /opt/venv
8 # source /opt/venv/bin/activate
9 # else
10 - source /opt/venv/bin/activate
11 -# fi
\ No newline at end of file
10 + # source /opt/venv/bin/activate
11 +# fi
12 +source /opt/venv-a0/bin/activate
\ No newline at end of file