Installeren
Om Ollama te installeren, voer je het volgende commando uit:
shell
curl -fsSL https://ollama.com/install.sh | shHandmatige installatie
Opmerking
Als je een upgrade uitvoert vanaf een eerdere versie, moet je eerst de oude bibliotheken verwijderen met sudo rm -rf /usr/lib/ollama.
Download en pak het pakket uit:
shell
curl -fsSL https://ollama.com/download/ollama-linux-amd64.tar.zst \
| sudo tar x -C /usrStart Ollama:
shell
ollama serveOpen een ander terminalvenster en controleer of Ollama actief is:
shell
ollama -vInstallatie voor AMD GPU
Als je een AMD GPU hebt, download en pak je ook het extra ROCm-pakket uit:
shell
curl -fsSL https://ollama.com/download/ollama-linux-amd64-rocm.tar.zst \
| sudo tar x -C /usrInstallatie voor ARM64
Download en pak het ARM64-specifieke pakket uit:
shell
curl -fsSL https://ollama.com/download/ollama-linux-arm64.tar.zst \
| sudo tar x -C /usrOllama toevoegen als opstartservice (aanbevolen)
Maak een gebruiker en groep aan voor Ollama:
shell
sudo useradd -r -s /bin/false -U -m -d /usr/share/ollama ollama
sudo usermod -a -G ollama $(whoami)Maak een servicebestand aan in /etc/systemd/system/ollama.service:
ini
[Unit]
Description=Ollama Service
After=network-online.target
[Service]
ExecStart=/usr/bin/ollama serve
User=ollama
Group=ollama
Restart=always
RestartSec=3
Environment="PATH=$PATH"
[Install]
WantedBy=multi-user.targetStart daarna de service:
shell
sudo systemctl daemon-reload
sudo systemctl enable ollamaCUDA-stuurprogramma's installeren (optioneel)
Download en installeer CUDA.
Controleer of de stuurprogramma's zijn geïnstalleerd door het volgende commando uit te voeren, dat informatie over je GPU moet weergeven:
shell
nvidia-smiAMD ROCm-stuurprogramma's installeren (optioneel)
Download en installeer ROCm v7.
Ollama starten
Start Ollama en controleer of deze actief is:
shell
sudo systemctl start ollama
sudo systemctl status ollamaOpmerking
Hoewel AMD de amdgpu-stuurprogramma heeft bijgedragen aan de upstream van de officiële Linux-kernel, is de versie verouderd en ondersteunt mogelijk niet alle ROCm-functies. We raden je aan de nieuwste stuurprogramma te downloaden van https://www.amd.com/en/support/linux-drivers voor optimale ondersteuning van je Radeon- GPU.
Aanpassen
Om de installatie van Ollama aan te passen, kun je het systemd-servicebestand of de omgevingsvariabelen bewerken door het volgende commando uit te voeren:
shell
sudo systemctl edit ollamaAls alternatief maak je handmatig een override-bestand aan in /etc/systemd/system/ollama.service.d/override.conf:
ini
[Service]
Environment="OLLAMA_DEBUG=1"Bijwerken
Werk Ollama bij door het installatiescript opnieuw uit te voeren:
shell
curl -fsSL https://ollama.com/install.sh | shOf door Ollama opnieuw te downloaden:
shell
curl -fsSL https://ollama.com/download/ollama-linux-amd64.tar.zst \
| sudo tar x -C /usrSpecifieke versies installeren
Gebruik de omgevingsvariabele OLLAMA_VERSION met het installatiescript om een specifieke versie van Ollama te installeren, inclusief voorlopige releases. Je vindt de versienummers op de releasespagina.
Bijvoorbeeld:
shell
curl -fsSL https://ollama.com/install.sh | OLLAMA_VERSION=0.5.7 shLogboeken bekijken
Om de logboeken van Ollama te bekijken wanneer deze als opstartservice draait, voer je het volgende commando uit:
shell
journalctl -e -u ollamaDeïnstalleren
Verwijder de Ollama-service:
shell
sudo systemctl stop ollama
sudo systemctl disable ollama
sudo rm /etc/systemd/system/ollama.serviceVerwijder de Ollama-bibliotheken uit je lib-map (ofwel /usr/local/lib, /usr/lib of /lib):
shell
sudo rm -r $(which ollama | tr 'bin' 'lib')Verwijder het Ollama-binairbestand uit je bin-map (ofwel /usr/local/bin, /usr/bin of /bin):
shell
sudo rm $(which ollama)Verwijder de gedownloade modellen en de gebruiker en groep van de Ollama-service:
shell
sudo userdel ollama
sudo groupdel ollama
sudo rm -r /usr/share/ollama