[PR #12454] scripts/install.sh: fail more gracefully when curl fails to downloa… #45073

Open
opened 2026-04-25 00:45:36 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/12454
Author: @jacobsalmela
Created: 9/30/2025
Status: 🔄 Open

Base: mainHead: fix-curl-no-pipefail


📝 Commits (1)

  • 04d9e17 scripts/install.sh: fail more gracefully when curl fails to download ollama.

📊 Changes

1 file changed (+7 additions, -3 deletions)

View changed files

📝 scripts/install.sh (+7 -3)

📄 Description

…d ollama.

previously, curl would download the assets and pipe it directly into tar. while effective, the bourne shell does not have a pipefail option, so if curl fails to download for some reason, tar continues to try to unpack an incomplete tarball, resulting in this:

+ status Downloading Linux arm64 bundle
+ echo >>> Downloading Linux arm64 bundle
>>> Downloading Linux arm64 bundle
+ curl --fail --show-error --location --progress-bar https://ollama.com/download/ollama-linux-arm64.tgz
+ sudo tar -xzf - -C /usr/local

gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
+ cleanup
+ rm -rf /tmp/tmp.gumWtEeeSU

the new behavior now fails more gracefully:

+ status Downloading Linux arm64 bundle
+ echo >>> Downloading Linux arm64 bundle
>>> Downloading Linux arm64 bundle
+ curl --fail --show-error --location --progress-bar --output ollama-linux-arm64.tgz https://ollama.com/download/ollama-linux-arm64.tgz

+ error Failed to download or extract Ollama
+ echo ERROR: Failed to download or extract Ollama
ERROR: Failed to download or extract Ollama
+ exit 1
+ cleanup
+ rm -rf /tmp/tmp.X3whvVjiUc

assuming the intent was to not leave assets behind by piping direct into tar, this is a more POSIX-compliant way to handle the situation when a piped command fails. it will remove the tarball after unpacking.


🔄 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/12454 **Author:** [@jacobsalmela](https://github.com/jacobsalmela) **Created:** 9/30/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix-curl-no-pipefail` --- ### 📝 Commits (1) - [`04d9e17`](https://github.com/ollama/ollama/commit/04d9e178de3a22f029f6cf0c40d94ef03d2c1bde) scripts/install.sh: fail more gracefully when `curl` fails to download ollama. ### 📊 Changes **1 file changed** (+7 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `scripts/install.sh` (+7 -3) </details> ### 📄 Description …d ollama. previously, `curl` would download the assets and pipe it directly into `tar`. while effective, the bourne shell does not have a `pipefail` option, so if `curl` fails to download for some reason, `tar` continues to try to unpack an incomplete tarball, resulting in this: ```text + status Downloading Linux arm64 bundle + echo >>> Downloading Linux arm64 bundle >>> Downloading Linux arm64 bundle + curl --fail --show-error --location --progress-bar https://ollama.com/download/ollama-linux-arm64.tgz + sudo tar -xzf - -C /usr/local gzip: stdin: unexpected end of file tar: Unexpected EOF in archive tar: Unexpected EOF in archive tar: Error is not recoverable: exiting now + cleanup + rm -rf /tmp/tmp.gumWtEeeSU ``` the new behavior now fails more gracefully: ```text + status Downloading Linux arm64 bundle + echo >>> Downloading Linux arm64 bundle >>> Downloading Linux arm64 bundle + curl --fail --show-error --location --progress-bar --output ollama-linux-arm64.tgz https://ollama.com/download/ollama-linux-arm64.tgz + error Failed to download or extract Ollama + echo ERROR: Failed to download or extract Ollama ERROR: Failed to download or extract Ollama + exit 1 + cleanup + rm -rf /tmp/tmp.X3whvVjiUc ``` assuming the intent was to not leave assets behind by piping direct into `tar`, this is a more POSIX-compliant way to handle the situation when a piped command fails. it will remove the tarball after unpacking. --- <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-25 00:45:36 -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#45073