Ubuntu下修改Ollama的模型存储路径

Linux系统的默认存储路径是/usr/share/ollama/.ollama/models

我想在Ubuntu下修改到/mnt/ollama-models

做法如下:

  1. 创建ollama服务的配置的覆盖文件

    shell 复制代码
    sudo mkdir -p /etc/systemd/system/ollama.service.d
    sudo vim /etc/systemd/system/ollama.service.d/override.conf
  2. 在override.conf文件里面写入:

    conf 复制代码
    [Service]
    Environment="OLLAMA_MODELS=/mnt/ollama-models"
    User=你的用户名
    Group=你的用户组
  3. 重启ollama服务

    shell 复制代码
    sudo systemctl daemon-reload
    sudo systemctl restart ollama
  4. 检查是否成功

    shell 复制代码
    sudo systemctl status ollama
    # 或者
    ollama list

参考:

相关推荐
元Y亨H5 天前
华硕主机重装 Ubuntu 系统完全指南
ubuntu
vi_h5 天前
在 macOS 上通过 Docker 安装并运行 Ollama(详细可执行教程)
macos·docker·ollama
曲幽5 天前
FastAPI流式输出实战与避坑指南:让AI像人一样“边想边说”
python·ai·fastapi·web·stream·chat·async·generator·ollama
字节逆旅6 天前
ubuntu应用深度守护
ubuntu
曲幽9 天前
FastAPI实战:打造本地文生图接口,ollama+diffusers让AI绘画更听话
python·fastapi·web·cors·diffusers·lcm·ollama·dreamshaper8·txt2img
曲幽11 天前
我用FastAPI接ollama大模型,差点被asyncio整崩溃(附对话窗口实战)
python·fastapi·web·async·httpx·asyncio·ollama
曲幽12 天前
FastAPI + Ollama 实战:搭一个能查天气的AI助手
python·ai·lora·torch·fastapi·web·model·ollama·weatherapi
欧云服务器12 天前
怎么让脚本命令可以同时在centos、debian、ubuntu执行?
ubuntu·centos·debian
智渊AI12 天前
Ubuntu 20.04/22.04 下通过 NVM 安装 Node.js 22(LTS 稳定版)
ubuntu·node.js·vim
The️13 天前
Linux驱动开发之Read_Write函数
linux·运维·服务器·驱动开发·ubuntu·交互