运行 ollama run gemma3:12b
时提示
pulling manifest
Error: pull model manifest: 412:
The model you are attempting to pull requires a newer version of Ollama.
Please download the latest version at:
https://ollama.com/download
这意味着,需要升级 ollama 版本,可以直接运行如下脚本进行升级
curl -fsSL https://ollama.com/install.sh | sh
输出日志如下
>>> Cleaning up old version at /usr/local/lib/ollama
>>> Installing ollama to /usr/local
>>> Downloading Linux amd64 bundle
######################################################################## 100.0%
>>> Adding ollama user to video group...
>>> Adding current user to ollama group...
>>> Creating ollama systemd service...
>>> Enabling and starting ollama service...
>>> NVIDIA GPU installed.
再次运行 ollama -v
确认版本即可。
需要注意的是,升级前请提前备份好 /etc/systemd/system/ollama.service
,该文件会被重写,ollama 升级完毕后,恢复该文件执行如下脚本即可
sudo systemctl daemon-reload
sudo systemctl restart ollama