Install
openclaw skills install ollama-updaterOllama Updater installs or updates Ollama with curl-based breakpoint resume, auto-retry, progress display, old version cleanup, and GPU driver detection.
openclaw skills install ollama-updater带断点续传功能的 Ollama 安装/更新工具,解决网络不稳定导致的下载中断问题。
curl -C - 实现下载中断后继续下载# 使用 OpenClaw
openclaw skills install ollama-updater
# 或使用 ClawHub
clawhub install ollama-updater
ollama-updater
OLLAMA_VERSION=0.5.7 ollama-updater
# 直接运行脚本
bash /path/to/ollama-updater/main.py
# 或使用 sudo
sudo bash /path/to/ollama-updater/main.py
使用 curl 的 -C - 参数实现断点续传:
# 普通下载(中断后需要从头开始)
curl -O https://example.com/file.tar.gz
# 断点续传(中断后可以继续)
curl -C - -O https://example.com/file.tar.gz
如果下载中断,只需重新运行命令,curl 会自动从断点处继续下载。
原因: 网络不稳定或服务器限速
解决:
原因: 需要 zstd 解压工具
解决:
# Debian/Ubuntu
sudo apt-get install zstd
# RHEL/CentOS/Fedora
sudo dnf install zstd
# Arch
sudo pacman -S zstd
原因: 需要 sudo 权限
解决:
sudo ollama-updater
| 功能 | 官方脚本 | ollama-updater |
|---|---|---|
| 断点续传 | ❌ | ✅ |
| 自动重试 | ❌ | ✅ (3 次) |
| 进度显示 | ✅ | ✅ |
| GPU 检测 | ✅ | ✅ |
| systemd 配置 | ✅ | ✅ |
download_file() {
local url="$1"
local output="$2"
local max_retries=3
local retry_count=0
while [ $retry_count -lt $max_retries ]; do
retry_count=$((retry_count + 1))
# 使用 -C - 实现断点续传
if curl --fail --show-error --location --progress-bar -C - -o "$output" "$url"; then
return 0
fi
if [ $retry_count -lt $max_retries ]; then
sleep 5
fi
done
error "Download failed after $max_retries attempts"
}
curl -C - 继续下载ollama-updater/
├── main.py # 主程序(包装官方脚本)
├── ollama-install.sh # 改进的安装脚本
├── SKILL.md # 技能说明
├── README.md # 使用指南
└── package.json # 包信息
MIT License