Uninstalling Ollama on Linux removes the service, binary, libraries, service account, and downloaded model data. Model data can be large and may be the only local copy of custom or pulled models, so decide what to preserve before removing directories.
The official uninstall steps stop and disable the service, remove the systemd unit, remove libraries and binary paths, and delete the service user and data directory. Run checks between destructive steps so a wrong path does not remove unrelated files.
Back up /usr/share/ollama or the active OLLAMA_MODELS directory before removing data that may need to be restored later.
Related: How to back up and restore Ollama data
Related: How to manage the Ollama service
Related: How to install Ollama on Linux
$ command -v ollama /usr/local/bin/ollama
$ sudo systemctl stop ollama $ sudo systemctl disable ollama
Related: How to manage the Ollama service
$ sudo rm -f /etc/systemd/system/ollama.service $ sudo systemctl daemon-reload
$ sudo rm -rf /usr/local/lib/ollama /usr/lib/ollama /lib/ollama $ sudo rm -f /usr/local/bin/ollama /usr/bin/ollama /bin/ollama
Confirm paths before running on systems with custom installs.
$ sudo rm -rf /usr/share/ollama $ sudo userdel ollama $ sudo groupdel ollama
This deletes downloaded model data for the service install.
$ command -v ollama $ systemctl status ollama Unit ollama.service could not be found.