From bdfd72e3119b3919a43b06bc4dbe9081520886c7 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Wed, 14 Jan 2026 18:04:13 +0100 Subject: [PATCH] Switch Ollama install to .tar.zst and add zstd dependency (#10814) --- ct/ollama.sh | 11 ++++++++--- ct/openwebui.sh | 13 +++++++++---- install/ollama-install.sh | 9 +++++---- install/openwebui-install.sh | 11 +++++++---- 4 files changed, 29 insertions(+), 15 deletions(-) diff --git a/ct/ollama.sh b/ct/ollama.sh index 56ad65db1..9797b6537 100644 --- a/ct/ollama.sh +++ b/ct/ollama.sh @@ -32,17 +32,22 @@ function update_script() { if [[ ! -f /opt/Ollama_version.txt ]]; then touch /opt/Ollama_version.txt fi + if ! command -v zstd &>/dev/null; then + msg_info "Installing zstd" + $STD apt install -y zstd + msg_ok "Installed zstd" + fi msg_info "Stopping Services" systemctl stop ollama msg_ok "Services Stopped" - TMP_TAR=$(mktemp --suffix=.tgz) - curl -fL# -C - -o "${TMP_TAR}" "https://github.com/ollama/ollama/releases/download/${RELEASE}/ollama-linux-amd64.tgz" + TMP_TAR=$(mktemp --suffix=.tar.zst) + curl -fL# -C - -o "${TMP_TAR}" "https://github.com/ollama/ollama/releases/download/${RELEASE}/ollama-linux-amd64.tar.zst" msg_info "Updating Ollama to ${RELEASE}" rm -rf /usr/local/lib/ollama rm -rf /usr/local/bin/ollama mkdir -p /usr/local/lib/ollama - tar -xzf "${TMP_TAR}" -C /usr/local/lib/ollama + tar --zstd -xf "${TMP_TAR}" -C /usr/local/lib/ollama ln -sf /usr/local/lib/ollama/bin/ollama /usr/local/bin/ollama rm -f "${TMP_TAR}" echo "${RELEASE}" >/opt/Ollama_version.txt diff --git a/ct/openwebui.sh b/ct/openwebui.sh index 864f43536..7260e5c17 100644 --- a/ct/openwebui.sh +++ b/ct/openwebui.sh @@ -92,12 +92,17 @@ EOF OLLAMA_VERSION=$(ollama -v | awk '{print $NF}') RELEASE=$(curl -s https://api.github.com/repos/ollama/ollama/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}') if [ "$OLLAMA_VERSION" != "$RELEASE" ]; then + if ! command -v zstd &>/dev/null; then + msg_info "Installing zstd" + $STD apt install -y zstd + msg_ok "Installed zstd" + fi msg_info "Ollama update available: v$OLLAMA_VERSION -> v$RELEASE" msg_info "Downloading Ollama v$RELEASE \n" - curl -fS#LO https://ollama.com/download/ollama-linux-amd64.tgz + curl -fS#LO https://github.com/ollama/ollama/releases/download/v${RELEASE}/ollama-linux-amd64.tar.zst msg_ok "Download Complete" - if [ -f "ollama-linux-amd64.tgz" ]; then + if [ -f "ollama-linux-amd64.tar.zst" ]; then msg_info "Stopping Ollama Service" systemctl stop ollama @@ -106,8 +111,8 @@ EOF msg_info "Installing Ollama" rm -rf /usr/lib/ollama rm -rf /usr/bin/ollama - tar -C /usr -xzf ollama-linux-amd64.tgz - rm -rf ollama-linux-amd64.tgz + tar --zstd -C /usr -xf ollama-linux-amd64.tar.zst + rm -rf ollama-linux-amd64.tar.zst msg_ok "Installed Ollama" msg_info "Starting Ollama Service" diff --git a/install/ollama-install.sh b/install/ollama-install.sh index c31926d63..5c08aeb45 100644 --- a/install/ollama-install.sh +++ b/install/ollama-install.sh @@ -16,7 +16,8 @@ update_os msg_info "Installing Dependencies" $STD apt install -y \ build-essential \ - pkg-config + pkg-config \ + zstd msg_ok "Installed Dependencies" msg_info "Setting up IntelĀ® Repositories" @@ -67,11 +68,11 @@ RELEASE=$(curl -fsSL https://api.github.com/repos/ollama/ollama/releases/latest OLLAMA_INSTALL_DIR="/usr/local/lib/ollama" BINDIR="/usr/local/bin" mkdir -p $OLLAMA_INSTALL_DIR -OLLAMA_URL="https://github.com/ollama/ollama/releases/download/${RELEASE}/ollama-linux-amd64.tgz" -TMP_TAR="/tmp/ollama.tgz" +OLLAMA_URL="https://github.com/ollama/ollama/releases/download/${RELEASE}/ollama-linux-amd64.tar.zst" +TMP_TAR="/tmp/ollama.tar.zst" echo -e "\n" if curl -fL# -C - -o "$TMP_TAR" "$OLLAMA_URL"; then - if tar -xzf "$TMP_TAR" -C "$OLLAMA_INSTALL_DIR"; then + if tar --zstd -xf "$TMP_TAR" -C "$OLLAMA_INSTALL_DIR"; then ln -sf "$OLLAMA_INSTALL_DIR/bin/ollama" "$BINDIR/ollama" echo "${RELEASE}" >/opt/Ollama_version.txt msg_ok "Installed Ollama ${RELEASE}" diff --git a/install/openwebui-install.sh b/install/openwebui-install.sh index 140ad0ee1..a85a84033 100644 --- a/install/openwebui-install.sh +++ b/install/openwebui-install.sh @@ -14,7 +14,9 @@ network_check update_os msg_info "Installing Dependencies" -$STD apt install -y ffmpeg +$STD apt install -y \ + ffmpeg \ + zstd msg_ok "Installed Dependencies" setup_hwaccel @@ -69,9 +71,10 @@ EOF msg_ok "Installed IntelĀ® oneAPI Base Toolkit" msg_info "Installing Ollama" - curl -fsSLO -C - https://ollama.com/download/ollama-linux-amd64.tgz - tar -C /usr -xzf ollama-linux-amd64.tgz - rm -rf ollama-linux-amd64.tgz + OLLAMA_RELEASE=$(curl -fsSL https://api.github.com/repos/ollama/ollama/releases/latest | grep "tag_name" | awk -F '"' '{print $4}') + curl -fsSLO -C - https://github.com/ollama/ollama/releases/download/${OLLAMA_RELEASE}/ollama-linux-amd64.tar.zst + tar --zstd -C /usr -xf ollama-linux-amd64.tar.zst + rm -rf ollama-linux-amd64.tar.zst cat </etc/systemd/system/ollama.service [Unit] Description=Ollama Service