前言: 在Steam OS上執行OLLAMA是比較麻煩的,因為預設的暫存空間只有5GB,但如果用Distrobox就可以突破這個限制,加上在Distrobox上怎樣裝插件/更新也不會影響本來STEAM OS的設定。
教程:
- 首先在Terminal 執行以下安裝Distrobox
curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/install | sh
- 建立UBUNTU及進入VM
distrobox create --name ubuntu-dev --image ubuntu:22.04
distrobox-enter ubuntu-dev
- 安裝基本PACKAGES
apt-get update
apt-get install -y sudo curl pciutils bash-completion
- 安裝OLLAMA
curl -fsSL https://ollama.com/install.sh | sh
- 執行
ollama
查看是否安裝成功,如成功會看到以下
📦[deck@ubuntu-dev ~]$ ollama
Usage:
ollama [flags]
ollama [command]
Available Commands:
serve Start ollama
create Create a model
show Show information for a model
run Run a model
stop Stop a running model
pull Pull a model from a registry
push Push a model to a registry
list List models
ps List running models
cp Copy a model
rm Remove a model
help Help about any command
Flags:
-h, --help help for ollama
-v, --version Show version information
執行 ollama serve
開 LLM Server
開啟另一個Terminal,執行以下 (這裡用了Google的小模型 Gemma3n
為例,可以到 https://ollama.com/search 尋找其他模型如 deepseek
, llama
, <7b 的模型應該都可以跑動)
distrobox-enter ubuntu-dev
ollama run gemma3n
然後即可和LLM對話,用完後記得在步驟5的TERMINAL也按 CTRL+C
,不然會佔著內存
