From d6b027e96923cf65fd2b7a5cfd35a74203003a56 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 28 Sep 2024 22:26:59 +0800 Subject: [PATCH] Update ubuntu.sh --- scripts/install/ubuntu.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/install/ubuntu.sh b/scripts/install/ubuntu.sh index e9f13a8d1..bad4bebaa 100644 --- a/scripts/install/ubuntu.sh +++ b/scripts/install/ubuntu.sh @@ -4,6 +4,12 @@ export PATH export LANG=en_US.UTF-8 export DEBIAN_FRONTEND=noninteractive +function version_gt() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; } +function version_le() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" == "$1"; } +function version_lt() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" != "$1"; } +function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; } + + if grep -Eq "Ubuntu" /etc/*-release; then sudo ln -sf /bin/bash /bin/sh #sudo dpkg-reconfigure dash @@ -27,6 +33,12 @@ apt install -y libncurses5-dev apt install -y software-properties-common apt install -y bzip2 +P_VER=`python3 -V | awk '{print $2}'` +if version_ge "$P_VER" "3.11.0" ;then + echo -e "\e[1;31mapt install python3.12-venv\e[0m" + apt install -y python3.12-venv +fi + # choose lang cmd # dpkg-reconfigure --frontend=noninteractive locales # dpkg-reconfigure locales