[PR #14340] install: do not remove existing install until after download #14628

Open
opened 2026-04-13 00:59:31 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14340
Author: @BruceMacD
Created: 2/20/2026
Status: 🔄 Open

Base: mainHead: brucemacd/download-before-remove


📝 Commits (1)

  • 04b337f install: do not remove existing install until after download

📊 Changes

1 file changed (+46 additions, -23 deletions)

View changed files

📝 scripts/install.sh (+46 -23)

📄 Description

Previously, the install script would stop ollama and delete the existing installation before downloading the new version. If the download failed (network error, disk full, etc.), the user was left with no working ollama.

Changes

  • Download-then-replace (macOS and Linux): All downloads now complete to a temp directory first. Only after success does the script stop the running instance, remove the old installation, and move the new files into place.
  • Remove $SUDO from download_and_extract tar commands: Since extraction now targets a user-owned temp directory instead of the root-owned install directory, $SUDO is no longer needed at this point.
  • Use install filesystem for temp directory (Linux): Instead of extracting to /tmp (which may be a small RAM-backed tmpfs, especially on WSL2), the temp directory is created on the same filesystem as the install directory (/usr/local/.ollama-install.XXXXXX). This avoids "No space left on device" errors from the ~7GB of CUDA libraries.
  • Stop ollama before replacing binaries (Linux): Added a step to stop the running ollama service (via systemctl stop or pkill) after the download but before the copy. This prevents "Text file busy" errors when overwriting the running binary.
  • Wait for server readiness (macOS): After open -a Ollama, the script now polls localhost:11434 for up to 5 seconds so the user doesn't get a terminated process if they run ollama immediately after install.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/14340 **Author:** [@BruceMacD](https://github.com/BruceMacD) **Created:** 2/20/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `brucemacd/download-before-remove` --- ### 📝 Commits (1) - [`04b337f`](https://github.com/ollama/ollama/commit/04b337f58fdf50b05d0000cfd9691ef8fedd890d) install: do not remove existing install until after download ### 📊 Changes **1 file changed** (+46 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `scripts/install.sh` (+46 -23) </details> ### 📄 Description Previously, the install script would stop ollama and delete the existing installation before downloading the new version. If the download failed (network error, disk full, etc.), the user was left with no working ollama. **Changes** - Download-then-replace (macOS and Linux): All downloads now complete to a temp directory first. Only after success does the script stop the running instance, remove the old installation, and move the new files into place. - Remove $SUDO from download_and_extract tar commands: Since extraction now targets a user-owned temp directory instead of the root-owned install directory, $SUDO is no longer needed at this point. - Use install filesystem for temp directory (Linux): Instead of extracting to /tmp (which may be a small RAM-backed tmpfs, especially on WSL2), the temp directory is created on the same filesystem as the install directory (/usr/local/.ollama-install.XXXXXX). This avoids "No space left on device" errors from the ~7GB of CUDA libraries. - Stop ollama before replacing binaries (Linux): Added a step to stop the running ollama service (via systemctl stop or pkill) after the download but before the copy. This prevents "Text file busy" errors when overwriting the running binary. - Wait for server readiness (macOS): After open -a Ollama, the script now polls localhost:11434 for up to 5 seconds so the user doesn't get a terminated process if they run ollama immediately after install. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 00:59:31 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#14628