Skip to content

Commit 8e79787

Browse files
authored
Ollama: Clean up old Ollama files before running update (#5534)
* Update ollama.sh * Update openwebui.sh
1 parent 1e05867 commit 8e79787

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

ct/ollama.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ function update_script() {
3838
TMP_TAR=$(mktemp --suffix=.tgz)
3939
curl -fL# -o "${TMP_TAR}" "https://github.com/ollama/ollama/releases/download/${RELEASE}/ollama-linux-amd64.tgz"
4040
msg_info "Updating Ollama to ${RELEASE}"
41+
rm -rf /usr/local/lib/ollama
42+
rm -rf /usr/local/bin/ollama
4143
tar -xzf "${TMP_TAR}" -C /usr/local/lib/ollama
4244
ln -sf /usr/local/lib/ollama/bin/ollama /usr/local/bin/ollama
4345
echo "${RELEASE}" >/opt/Ollama_version.txt

ct/openwebui.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ function update_script() {
3030

3131
if [ -x "/usr/bin/ollama" ]; then
3232
msg_info "Updating Ollama"
33+
rm -rf /usr/lib/ollama
34+
rm -rf /usr/bin/ollama
3335
OLLAMA_VERSION=$(ollama -v | awk '{print $NF}')
3436
RELEASE=$(curl -s https://api.github.com/repos/ollama/ollama/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}')
3537
if [ "$OLLAMA_VERSION" != "$RELEASE" ]; then

0 commit comments

Comments
 (0)