GitHub下载 安装包,上传到 Linux 服务器后:
# 解压
sudo tar -C /usr -xzf ollama-linux-amd64.tgz
# 启动
ollama serve
# 验证
ollama -v
可查看《手动安装文档》的 Updating 章节:
<font style="color:rgb(202, 225, 244);background-color:rgb(10, 14, 18);">Update Ollama by running the install script again:</font>
curl -fsSL https://ollama.com/install.sh | sh
<font style="color:rgb(202, 225, 244);background-color:rgb(10, 14, 18);">Or by re-downloading Ollama:</font>
curl -L https://ollama.com/download/ollama-linux-amd64.tgz -o ollama-linux-amd64.tgz
sudo tar -C /usr -xzf ollama-linux-amd64.tgz
实际上就是覆盖之前的安装文件。
下载最新版本安装包并上传服务器后:
# 依然是解压
tar -zxvf ollama-linux-amd64.tgz
# 输出日志(0.5.11升级到0.6.2)
bin/ollama
lib/ollama/cuda_v11/
lib/ollama/cuda_v11/libcublas.so.11
lib/ollama/cuda_v11/libggml-cuda.so
gzip: stdin: invalid compressed data--format violated
tar: 归档文件中异常的 EOF
tar: 归档文件中异常的 EOF
tar: Error is not recoverable: exiting now
# 输出日志(0.6.2升级到0.6.8)
bin/ollama
lib/ollama/cuda_v11/
lib/ollama/cuda_v11/libcudart.so.11.0
lib/ollama/cuda_v11/libcublas.so.11.5.1.109
lib/ollama/cuda_v11/libcublasLt.so.11
lib/ollama/cuda_v11/libcublas.so.11
lib/ollama/cuda_v11/libcudart.so.11.3.109
lib/ollama/cuda_v11/libggml-cuda.so
lib/ollama/cuda_v11/libcublasLt.so.11.5.1.109
lib/ollama/cuda_v12/
lib/ollama/cuda_v12/libcudart.so.12
lib/ollama/cuda_v12/libcublasLt.so.12
lib/ollama/cuda_v12/libcublas.so.12
lib/ollama/cuda_v12/libcudart.so.12.8.90
lib/ollama/cuda_v12/libcublas.so.12.8.4.1
lib/ollama/cuda_v12/libcublasLt.so.12.8.4.1
lib/ollama/cuda_v12/libggml-cuda.so
lib/ollama/libggml-base.so
lib/ollama/libggml-cpu-alderlake.so
lib/ollama/libggml-cpu-haswell.so
lib/ollama/libggml-cpu-icelake.so
lib/ollama/libggml-cpu-sandybridge.so
lib/ollama/libggml-cpu-skylakex.so
lib/ollama/libggml-cpu-sse42.so
lib/ollama/libggml-cpu-x64.so
可以忽略升级过程中的日志输出。
使用 lscpu
查看 CPU 核心数:
# 查询命令
lscpu
# 输出结果
架构: x86_64
CPU 运行模式: 32-bit, 64-bit
Address sizes: 46 bits physical, 48 bits virtual
字节序: Little Endian
CPU: 40
在线 CPU 列表: 0-39
启动脚本:
export OMP_NUM_THREADS=40
export OLLAMA_NUM_THREADS=40
export OLLAMA_NUM_PARALLEL=0
export OLLAMA_KEEP_ALIVE="2h"
export OLLAMA_MODELS=/root/.ollama/models
export OLLAMA_FLASH_ATTENTION=1
export OLLAMA_HOST=0.0.0.0:11434
nohup ./ollama serve >> serve.log 2>&1 &
# 没有开启
export OLLAMA_DEBUG=1
export OLLAMA_HOST=0.0.0.0:11434
export OLLAMA_KEEP_ALIVE="2h"
export OLLAMA_ORIGINS="http://example.com,https://localhost"
export OLLAMA_KV_CACHE_TYPE="q4_0"
export OLLAMA_LOAD_TIMEOUT="10m"
Error: pull model manifest: Get "https://registry.ollama.ai/v2/library/qwen3/manifests/0.6b": read tcp xxx.xxx.x.xxx:49086->104.21.75.227:443: read: connection reset by peer
公司内网问题,所有的服务器都无法下载模型文件,我使用云服务器下载模型,进行了离线导入。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。