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.

Steps to uninstall Ollama on Linux:

  1. Check where the active Ollama binary resolves.
    $ command -v ollama
    /usr/local/bin/ollama
  2. Stop and disable the service.
    $ sudo systemctl stop ollama
    $ sudo systemctl disable ollama
  3. Remove the systemd service file.
    $ sudo rm -f /etc/systemd/system/ollama.service
    $ sudo systemctl daemon-reload
  4. Remove the Ollama libraries and binary.
    $ 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.

  5. Remove model data and the service account only after backup decisions are complete.
    $ sudo rm -rf /usr/share/ollama
    $ sudo userdel ollama
    $ sudo groupdel ollama

    This deletes downloaded model data for the service install.

  6. Verify the command and service are gone.
    $ command -v ollama
    $ systemctl status ollama
    Unit ollama.service could not be found.