While Ollama offers robust functionality as an AI model server, there might come a time when you need to uninstall it completely from your Linux system. Whether you’re troubleshooting, upgrading, or simply cleaning your system, this guide provides clear and concise steps to safely remove Ollama entirely.
Step 1: Stop and Disable the Ollama Service
Before removing any files, ensure the Ollama service is stopped and disabled:
sudo systemctl stop ollama sudo systemctl disable ollama
Step 2: Remove the Ollama Service Configuration
Delete the Ollama systemd service file to prevent automatic restarts:
sudo rm /etc/systemd/system/ollama.service
Step 3: Delete Ollama Binaries
Locate and delete the Ollama executable binary:
sudo rm $(which ollama)
Step 4: Remove Ollama Files and User Accounts
To ensure a clean uninstallation, remove remaining Ollama files, directories, and user/group accounts:
sudo rm -rf /usr/share/ollama sudo userdel ollama sudo groupdel ollama
Step 5: Verify Complete Removal
Ensure no leftover Ollama services or configurations exist:
systemctl list-units --type=service | grep ollama
If you receive no output, Ollama has been successfully removed from your system.