[PR #11716] [CLOSED] script/install.sh: Resume large downloads when rerun after error #39484

Closed
opened 2026-04-23 00:20:11 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/11716
Author: @ic
Created: 8/6/2025
Status: Closed

Base: mainHead: main


📝 Commits (4)

  • a18eb12 Make download resuming possible on large files
  • 20e5c74 Add missing trap handlers
  • 5b63d81 Fix EXIT trap function call
  • 5b23459 Merge branch 'ollama:main' into main

📊 Changes

1 file changed (+30 additions, -11 deletions)

View changed files

📝 scripts/install.sh (+30 -11)

📄 Description

Problem

Install can take time and fail for a range of reasons, typically network loss when many Linux distributions default to go power saving. Reruns of the script so far restart from zero, getting large bundles again for Ollama, Nvidia or AMD.

Importance

Adopting Ollama can be improved and broadened with an install script that helps across runs.

Proposed change

The changes are all in scripts/install.sh to modify two aspects:

  1. Large downloads via cURL adopt new option flags to resume downloads where they last stopped.
  2. Extended cleanup at the end of the script, to decide keeping pending download on error, and cleanup all on success.

(1) requires to save files to disc (to get something to resume from), so the original pipe to tar is split into two commands with files saved in a dedicated temporary directory. (2) provides an extended logic depending on the script success or error, but also the use of a predictable temporary directory path (instead of mktemp -d).

Tests

  • Fresh install on an Ubuntu 22 machine with an Nvidia GTX1050Ti
  • Fresh install on an Ubuntu 24 machine with an AMD AI Max+ 395 system featuring a Radeon 8060S

The tests included scenarios:

a. Success of the script
b. Cut networking while downloading. Resumes when network is back.
c. Files kept on SIGINT. Resumes on rerun.

Not tested, but supported in the code: Same processing for SIGHUP and SIGTERM.


🔄 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/11716 **Author:** [@ic](https://github.com/ic) **Created:** 8/6/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (4) - [`a18eb12`](https://github.com/ollama/ollama/commit/a18eb1292e6ddae0d22af3e9caaa609d7f04e51b) Make download resuming possible on large files - [`20e5c74`](https://github.com/ollama/ollama/commit/20e5c74316311c17e54968f2f693b50f20210744) Add missing trap handlers - [`5b63d81`](https://github.com/ollama/ollama/commit/5b63d8190cf1fe41b053083faf067324bfb1bf9c) Fix EXIT trap function call - [`5b23459`](https://github.com/ollama/ollama/commit/5b2345992e5a8a4284325dd63ab3b590271709fd) Merge branch 'ollama:main' into main ### 📊 Changes **1 file changed** (+30 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `scripts/install.sh` (+30 -11) </details> ### 📄 Description ### Problem Install can take time and fail for a range of reasons, typically network loss when many Linux distributions default to go power saving. Reruns of the script so far restart from zero, getting large bundles again for Ollama, Nvidia or AMD. ### Importance Adopting Ollama can be improved and broadened with an install script that helps across runs. ### Proposed change The changes are all in `scripts/install.sh` to modify two aspects: 1. Large downloads via cURL adopt new option flags to resume downloads where they last stopped. 2. Extended cleanup at the end of the script, to decide keeping pending download on error, and cleanup all on success. (1) requires to save files to disc (to get something to resume from), so the original pipe to `tar` is split into two commands with files saved in a dedicated temporary directory. (2) provides an extended logic depending on the script success or error, but also the use of a predictable temporary directory path (instead of `mktemp -d`). ### Tests * Fresh install on an Ubuntu 22 machine with an Nvidia GTX1050Ti * Fresh install on an Ubuntu 24 machine with an AMD AI Max+ 395 system featuring a Radeon 8060S The tests included scenarios: a. Success of the script b. Cut networking while downloading. Resumes when network is back. c. Files kept on SIGINT. Resumes on rerun. Not tested, but supported in the code: Same processing for SIGHUP and SIGTERM. --- <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-23 00:20:11 -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#39484