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

参考:

相关推荐
Uncertainty!!1 小时前
Ubuntu 22.04 安装超好用中文输入法rime-ice(雾凇拼音)过程记录
linux·ubuntu·中文输入法
HAPPY酷7 小时前
【ROS2】 Conda 环境搭建(命令行版)
linux·运维·python·ubuntu·机器人·conda
醉熏的石头1 天前
Ubuntu 中的编程语言(中)
linux·ubuntu·scala
bukeyiwanshui1 天前
20260622 安装配置ubuntu
linux·运维·ubuntu
AI的探索之旅2 天前
从 Ubuntu 14.04 到 24.04:TI AM335x 开发环境完整迁移与 Agent 接管方案
linux·数据库·嵌入式硬件·ubuntu·postgresql
Koma-forever2 天前
OpenClaw-使用本地Ollamam模型(opencalw config+ ollama launch)
ollama·openclaw
一池秋_2 天前
ubuntu(linux)完美复刻windows11字体,解决linux字体费眼晴
linux·运维·ubuntu
艾莉丝努力练剑2 天前
OpenCode AI 编程:Ubuntu 24.04 环境安装与使用指南
linux·服务器·网络·人工智能·tcp/ip·ubuntu
Tian_Hang2 天前
Eclipse Ditto 的权限策略
java·服务器·前端·网络·ide·ubuntu·eclipse
一杯奶茶¥3 天前
Ubuntu系统镜像各个版本下载Ubuntu镜像合集资源Linux系统镜像乌班图Linux系统镜像
linux·运维·ubuntu·镜像·;inux镜像·ubuntu镜像