linux离线安装ollama

  • 380
  • 3月前
  • 0

– 技术文章
linux离线安装ollama

从github下载ollama的release版本,x86服务器下载amd64的版本 https://github.com/ollama/ollama/releases下载你要安装的版并上传到服务器,我传到/home目录下

下载install.sh

https://github.com/ollama/ollama/blob/main/scripts/install.sh
将install.sh中的以下内容修改为如图所示的内容,绕过下载

status "Downloading Linux ${ARCH} bundle"
curl --fail --show-error --location --progress-bar \
    "https://ollama.com/download/ollama-linux-${ARCH}.tgz${VER_PARAM}" | \
    $SUDO tar -xzf - -C "$OLLAMA_INSTALL_DIR"

替换为:

status "Downloading Linux ${ARCH} bundle"
#curl --fail --show-error --location --progress-bar \
#    "https://ollama.com/download/ollama-linux-${ARCH}.tgz${VER_PARAM}" | \
$SUDO tar -xzf /data/ryy/ollama-linux-amd64.tgz -C "$OLLAMA_INSTALL_DIR"
切换:
 $SUDO tar -xzf - -C "$OLLAMA_INSTALL_DIR"
换成刚刚下载好的

$SUDO tar -xzf /home/ollama-linux-amd64.tgz -C "$OLLAMA_INSTALL_DIR"

执行sh install.sh


执行ollama --version,显示以下代表安装成功

ollama version is 0.5.7


2.112997s