From 8e7978713f76efc9890895f76dcc5dc63f2303e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Slavi=C5=A1a=20Are=C5=BEina?= <58952836+tremor021@users.noreply.github.com> Date: Sat, 28 Jun 2025 12:21:55 +0200 Subject: [PATCH] Ollama: Clean up old Ollama files before running update (#5534) * Update ollama.sh * Update openwebui.sh --- ct/ollama.sh | 2 ++ ct/openwebui.sh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ct/ollama.sh b/ct/ollama.sh index f12274483..1470a499e 100644 --- a/ct/ollama.sh +++ b/ct/ollama.sh @@ -38,6 +38,8 @@ function update_script() { TMP_TAR=$(mktemp --suffix=.tgz) curl -fL# -o "${TMP_TAR}" "https://github.com/ollama/ollama/releases/download/${RELEASE}/ollama-linux-amd64.tgz" msg_info "Updating Ollama to ${RELEASE}" + rm -rf /usr/local/lib/ollama + rm -rf /usr/local/bin/ollama tar -xzf "${TMP_TAR}" -C /usr/local/lib/ollama ln -sf /usr/local/lib/ollama/bin/ollama /usr/local/bin/ollama echo "${RELEASE}" >/opt/Ollama_version.txt diff --git a/ct/openwebui.sh b/ct/openwebui.sh index 0824a7977..dffb9dd01 100644 --- a/ct/openwebui.sh +++ b/ct/openwebui.sh @@ -30,6 +30,8 @@ function update_script() { if [ -x "/usr/bin/ollama" ]; then msg_info "Updating Ollama" + rm -rf /usr/lib/ollama + rm -rf /usr/bin/ollama 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