AI摘要
解决网络更新慢问题:使用GitHub加速代理,wget替换curl,创建update.sh脚本自动下载安装ollama,需关闭网络代理并指定版本号。
更新慢一般都是网络问题,我是因为更新了clash最新版本后,导致网络十分的不稳定,经常被拒绝连接;
解决方法是使用github加速代理,wget下载命令行替换curl;需要创建update.sh脚本,一键执行更新或者下载ollama;
VERSION版本需要在github项目上查看
如果使用网络代理需要关闭;
update.sh脚本代码
#!/bin/bash
# 文件路径
FILE="ollama_install.sh"
VERSION='v0.11.10'
# 下载ollama安装脚本
rm ${FILE}
curl -fsSL https://ollama.com/install.sh -o ${FILE}
# 修改 URL
sed -i 's|https://ollama.com/download/ollama-linux|https://gh.llkk.cc/https://github.com/ollama/ollama/releases/download/'"${VERSION}"'/ollama-linux|g' ${FILE}
# 修改脚本中的curl命令为wget
sed -i 's|curl --fail --show-error --location --progress-bar|wget -c --progress=bar --timeout=60 --tries=30 --waitretry=30 -O -|g' ${FILE}
# 执行ollama安装脚本
chmod +x ${FILE}
./${FILE}

暂无评论
要发表评论,您必须先 登录