Switch Ollama install to .tar.zst and add zstd dependency (#10814)

This commit is contained in:
CanbiZ (MickLesk)
2026-01-14 18:04:13 +01:00
committed by GitHub
parent fa1f2784f9
commit bdfd72e311
4 changed files with 29 additions and 15 deletions

View File

@@ -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

View File

@@ -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"