ollama - 💡(How to fix) Fix Proposal: Add Official Uninstall Documentation and Scripts [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
ollama/ollama#15324Fetched 2026-04-08 02:44:07
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
1
Participants
Timeline (top)
labeled ×1

Code Example

# 1. Kill any running Ollama processes
pkill -f ollama

# 2. Remove the symlink created by the script
sudo rm /usr/local/bin/ollama

# 3. Remove the core application bundle
sudo rm -rf /Applications/Ollama.app

# 4. Wipe the model directory and cache
rm -rf ~/.ollama

---

if ! command -v ollama &> /dev/null; then if [ -d ~/.ollama ]; then echo -e "✅ Ollama app is removed, but model weights remain.\n💡 To delete them, run: rm -rf ~/.ollama"; else echo "Ollama and all model weights have been completely removed."; fi; else echo "Ollama is still installed."; fi

---

# 1. Kill the background Ollama processes
Stop-Process -Name "ollama" -Force -ErrorAction SilentlyContinue
Stop-Process -Name "ollama app" -Force -ErrorAction SilentlyContinue

# 2. Trigger the official uninstaller exactly as Windows would, but silently
$UninstallExe = "$env:LOCALAPPDATA\Programs\Ollama\unins000.exe"
if (Test-Path $UninstallExe) {
    Start-Process -FilePath $UninstallExe -ArgumentList "/VERYSILENT", "/SUPPRESSMSGBOXES", "/NORESTART" -Wait
}

# 3. Clean up any orphaned AppData folders left behind
Remove-Item -Recurse -Force "$env:LOCALAPPDATA\Programs\Ollama" -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force "$env:LOCALAPPDATA\Ollama" -ErrorAction SilentlyContinue

# 4. Wipe the downloaded models
Remove-Item -Recurse -Force "$env:USERPROFILE\.ollama" -ErrorAction SilentlyContinue

---

if (!(Get-Command ollama -ErrorAction SilentlyContinue)) { if (Test-Path "$env:USERPROFILE\.ollama") { Write-Host "✅ Ollama app is removed, but model weights remain.`n💡 To delete them, run: Remove-Item -Recurse -Force `"$env:USERPROFILE\.ollama`"" -ForegroundColor Yellow } else { Write-Host "✅ Ollama and all model weights have been completely removed." -ForegroundColor Green } } else { Write-Host "❌ Ollama is still installed." -ForegroundColor Red }

---

# 1. Stop and disable the background service
sudo systemctl stop ollama
sudo systemctl disable ollama

# 2. Remove the systemd service file and refresh the daemon
sudo rm /etc/systemd/system/ollama.service
sudo systemctl daemon-reload

# 3. Remove the binaries
sudo rm $(which ollama)
# (Optional fallback if the script placed libraries here)
sudo rm -rf /usr/local/lib/ollama 

# 4. Delete the dedicated system user and group created by the script
sudo userdel ollama
sudo groupdel ollama

# 5. Wipe the root-level model directory
sudo rm -rf /usr/share/ollama

# 6. Wipe any local user models (if you ran models without the system service)
sudo rm -rf ~/.ollama

---

if ! command -v ollama &> /dev/null; then if [ -d ~/.ollama ] || [ -d /usr/share/ollama ]; then echo -e "✅ Ollama app is removed, but model weights remain.\n💡 To delete them, run: sudo rm -rf ~/.ollama /usr/share/ollama"; else echo "Ollama and all model weights have been completely removed."; fi; else echo "Ollama is still installed."; fi
RAW_BUFFERClick to expand / collapse

The Problem

Currently, the official install scripts make it incredibly easy to get Ollama running, but there is no readily discoverable documentation or automated method for cleanly uninstalling it. Users who want to remove the software or do a clean reinstall are often left guessing which directories to clean up, occasionally leaving gigabytes of orphaned model weights behind.

The Proposed Solution

I have reverse-engineered the official install.sh and install.ps1 scripts to create accurate, manual teardown commands for macOS, Windows, and Linux.

In addition to the documentation, I have written three interactive uninstall scripts (.sh and .ps1). These scripts:

  • Safely stop background services/processes.
  • Remove binaries, symlinks, and systemd files.
  • Clean up dedicated system users (Linux).
  • Interactively prompt the user, asking if they want to keep or delete their downloaded .ollama models.

Handing over the baton

I am relatively new to GitHub, so I am opening this Issue rather than a Pull Request. I am offering these scripts and the README addition as a community contribution for the Ollama team to adopt, modify, and maintain moving forward as you see fit!

1. The Proposed README Additions (Uninstall.md):

<details> <summary>Click to expand</summary>

🤖 The Ollama Uninstall Guide MacOS/Windows/Linux

Currently, the official install scripts make it incredibly easy to get Ollama running, but there is no readily discoverable documentation for cleanly uninstalling it.

I propose adding a dedicated Uninstall.md file to the repository. Placing this in its own explicitly named file makes it much easier for users to find when they need to remove the software or do a clean reinstall, rather than burying it inside a general troubleshooting guide.

Below, you will find the accurate, reverse-engineered manual teardown commands for macOS, Windows, and Linux. I have also included interactive script files (.sh and .ps1) in this folder if you prefer an automated one-click removal.

[!WARNING] Regarding model data: The optional manual commands below to remove the .ollama directories will completely wipe your downloaded models and cache. If using the automated scripts, you will be interactively prompted to keep or delete these files.

Package Manager Note: These teardowns and scripts are designed only for users who installed Ollama via the official download links or curl scripts. If you installed Ollama using a package manager (like Homebrew, Winget, Chocolatey, or Docker), please use your package manager's native uninstall commands instead.


🍎 macOS

The Setup: curl -fsSL https://ollama.com/install.sh | sh The Reality: The Mac script is essentially a downloader. It downloads a compressed .zip file containing Ollama.app, extracts it directly into /Applications, and creates a symbolic link in /usr/local/bin so the terminal recognizes the ollama command. It stores downloaded model blobs in ~/.ollama.

The Accurate Teardown:

# 1. Kill any running Ollama processes
pkill -f ollama

# 2. Remove the symlink created by the script
sudo rm /usr/local/bin/ollama

# 3. Remove the core application bundle
sudo rm -rf /Applications/Ollama.app

# 4. Wipe the model directory and cache
rm -rf ~/.ollama

The Automated Method (Using the Script): If you prefer not to enter the commands manually, you can use the included uninstall-mac.sh script. This script executes the teardown safely and will interactively ask if you want to keep or delete your downloaded models.

  • Open Terminal and navigate to the directory containing the script.
  • Make it executable: chmod +x uninstall-mac.sh
  • Run the script: ./uninstall-mac.sh

[!NOTE] You will be prompted for your administrator password to remove the application bundle.


[!TIP] ✅ Verify Uninstallation

To confirm that Ollama has been completely removed from your system, and to check if any heavy model weights were left behind, run this quick check in your terminal:

if ! command -v ollama &> /dev/null; then if [ -d ~/.ollama ]; then echo -e "✅ Ollama app is removed, but model weights remain.\n💡 To delete them, run: rm -rf ~/.ollama"; else echo "✅ Ollama and all model weights have been completely removed."; fi; else echo "❌ Ollama is still installed."; fi

🪟 Windows

The Setup: irm https://ollama.com/install.ps1 | iex The Reality: The PowerShell script does not install Ollama manually. It simply downloads OllamaSetup.exe into a temporary directory and executes it with a silent flag (/SILENT). The .exe then writes the core application into your Local AppData folder and registers an official uninstaller (unins000.exe) with Windows. Models are saved in C:\Users\<YourUsername>\.ollama.

The Accurate Teardown (via PowerShell as Administrator):

# 1. Kill the background Ollama processes
Stop-Process -Name "ollama" -Force -ErrorAction SilentlyContinue
Stop-Process -Name "ollama app" -Force -ErrorAction SilentlyContinue

# 2. Trigger the official uninstaller exactly as Windows would, but silently
$UninstallExe = "$env:LOCALAPPDATA\Programs\Ollama\unins000.exe"
if (Test-Path $UninstallExe) {
    Start-Process -FilePath $UninstallExe -ArgumentList "/VERYSILENT", "/SUPPRESSMSGBOXES", "/NORESTART" -Wait
}

# 3. Clean up any orphaned AppData folders left behind
Remove-Item -Recurse -Force "$env:LOCALAPPDATA\Programs\Ollama" -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force "$env:LOCALAPPDATA\Ollama" -ErrorAction SilentlyContinue

# 4. Wipe the downloaded models
Remove-Item -Recurse -Force "$env:USERPROFILE\.ollama" -ErrorAction SilentlyContinue

The Automated Method (Using the Script): If you prefer not to enter the commands manually, you can use the included uninstall-windows.ps1 script. This script triggers the silent uninstaller, cleans up orphaned folders, and interactively asks if you want to keep or delete your downloaded models.

Method 1 (File Explorer): Right-click the uninstall-windows.ps1 and select Run with PowerShell. Click "Yes" if prompted by UAC. Method 2 (Terminal): Open PowerShell as Administrator, navigate to the script's folder, and run: .\uninstall-windows.ps1


[!TIP] ✅ Verify Uninstallation

To confirm that Ollama has been completely removed from your system, and to check if any heavy model weights were left behind, run this quick check in PowerShell:

if (!(Get-Command ollama -ErrorAction SilentlyContinue)) { if (Test-Path "$env:USERPROFILE\.ollama") { Write-Host "✅ Ollama app is removed, but model weights remain.`n💡 To delete them, run: Remove-Item -Recurse -Force `"$env:USERPROFILE\.ollama`"" -ForegroundColor Yellow } else { Write-Host "✅ Ollama and all model weights have been completely removed." -ForegroundColor Green } } else { Write-Host "❌ Ollama is still installed." -ForegroundColor Red }

🐧 Linux

The Setup: curl -fsSL https://ollama.com/install.sh | sh The Reality: The Linux script does heavy system-level configuration. It downloads the raw executable to /usr/local/bin/ollama, creates a dedicated background ollama user account (so the service can run securely without your personal user account), generates a systemd service file in /etc/systemd/system/, and sets the default model storage to /usr/share/ollama.

The Accurate Teardown:

# 1. Stop and disable the background service
sudo systemctl stop ollama
sudo systemctl disable ollama

# 2. Remove the systemd service file and refresh the daemon
sudo rm /etc/systemd/system/ollama.service
sudo systemctl daemon-reload

# 3. Remove the binaries
sudo rm $(which ollama)
# (Optional fallback if the script placed libraries here)
sudo rm -rf /usr/local/lib/ollama 

# 4. Delete the dedicated system user and group created by the script
sudo userdel ollama
sudo groupdel ollama

# 5. Wipe the root-level model directory
sudo rm -rf /usr/share/ollama

# 6. Wipe any local user models (if you ran models without the system service)
sudo rm -rf ~/.ollama

The Automated Method (Using the Script): If you prefer not to enter the commands manually, you can use the included uninstall-linux.sh script. This script safely stops the systemd services, removes the binaries and dedicated system user, and interactively asks if you want to keep or delete your downloaded models.

  • Open Terminal and navigate to the directory containing the script.
  • Make it executable: chmod +x uninstall-linux.sh
  • Run the script: ./uninstall-linux.sh

[!NOTE] You will be prompted for your sudo password to cleanly remove the background services and system user.


[!TIP] ✅ Verify Uninstallation

To confirm that Ollama has been completely removed from your system, and to check if any heavy model weights were left behind, run this quick check in your terminal:

if ! command -v ollama &> /dev/null; then if [ -d ~/.ollama ] || [ -d /usr/share/ollama ]; then echo -e "✅ Ollama app is removed, but model weights remain.\n💡 To delete them, run: sudo rm -rf ~/.ollama /usr/share/ollama"; else echo "✅ Ollama and all model weights have been completely removed."; fi; else echo "❌ Ollama is still installed."; fi

</details>

2. MacOS Uninstall Script (uninstall-mac.sh):

<details> <summary>Click to expand</summary>

#!/bin/bash

echo "🍎 Uninstalling Ollama for macOS..."

1. Kill running processes

pkill -f ollama

2. Remove symlink and application bundle

echo "Removing application files (you may be prompted for your password)..." sudo rm -f /usr/local/bin/ollama sudo rm -rf /Applications/Ollama.app

3. Prompt for model deletion

echo "" read -p "⚠️ Do you want to entirely delete all downloaded models and cache? (y/N): " wipe_models

if [[ "$wipe_models" =~ ^[Yy]$ ]]; then rm -rf ~/.ollama echo "🗑️ Models and cache deleted." else echo "💾 Models retained in ~/.ollama." fi

echo "✅ Ollama uninstalled successfully."

</details>

3. Linux Uninstall Script (uninstall-linux.sh):

<details> <summary>Click to expand</summary>

#!/bin/bash

echo "🐧 Uninstalling Ollama for Linux..." echo "Stopping services and removing binaries (you may be prompted for your password)..."

1. Stop and disable the background service

sudo systemctl stop ollama 2>/dev/null sudo systemctl disable ollama 2>/dev/null

2. Remove the systemd service file and refresh the daemon

sudo rm -f /etc/systemd/system/ollama.service sudo systemctl daemon-reload

3. Remove the binaries and libraries

OLLAMA_BIN=$(which ollama 2>/dev/null) if [ -n "$OLLAMA_BIN" ]; then sudo rm -f "$OLLAMA_BIN" fi sudo rm -rf /usr/local/lib/ollama

4. Delete the dedicated system user and group

sudo userdel ollama 2>/dev/null sudo groupdel ollama 2>/dev/null

5. Prompt for model deletion

echo "" read -p "⚠️ Do you want to entirely delete all downloaded models and cache? (y/N): " wipe_models

if [[ "$wipe_models" =~ ^[Yy]$ ]]; then sudo rm -rf /usr/share/ollama sudo rm -rf ~/.ollama echo "🗑️ Models and cache deleted." else echo "💾 Models retained in /usr/share/ollama and ~/.ollama." fi

echo "✅ Ollama uninstalled successfully."

</details>

4. Windows Uninstall Script (uninstall-windows.ps1):

<details> <summary>Click to expand</summary>

<# .SYNOPSIS Uninstalls Ollama from Windows, with an option to wipe downloaded models. Requires Administrator privileges. #>

Write-Host "🪟 Uninstalling Ollama for Windows..." -ForegroundColor Cyan

1. Kill background processes

Stop-Process -Name "ollama" -Force -ErrorAction SilentlyContinue Stop-Process -Name "ollama app" -Force -ErrorAction SilentlyContinue

2. Trigger the official uninstaller silently

$UninstallExe = "$env:LOCALAPPDATA\Programs\Ollama\unins000.exe" if (Test-Path $UninstallExe) { Write-Host "Running official uninstaller..." Start-Process -FilePath $UninstallExe -ArgumentList "/VERYSILENT", "/SUPPRESSMSGBOXES", "/NORESTART" -Wait }

3. Clean up orphaned AppData folders

Remove-Item -Recurse -Force "$env:LOCALAPPDATA\Programs\Ollama" -ErrorAction SilentlyContinue Remove-Item -Recurse -Force "$env:LOCALAPPDATA\Ollama" -ErrorAction SilentlyContinue

4. Prompt for model deletion

Write-Host "" $wipeModels = Read-Host "⚠️ Do you want to entirely delete all downloaded models and cache? (y/N)"

if ($wipeModels -match "^[Yy]") { Remove-Item -Recurse -Force "$env:USERPROFILE.ollama" -ErrorAction SilentlyContinue Write-Host "🗑️ Models and cache deleted." -ForegroundColor Red } else { Write-Host "💾 Models retained in $env:USERPROFILE.ollama." -ForegroundColor Green }

Write-Host "✅ Ollama uninstalled successfully." -ForegroundColor Green

</details>

extent analysis

TL;DR

To fix the issue of lacking a clean uninstallation method for Ollama, use the provided interactive uninstall scripts for macOS, Windows, and Linux, which safely stop background services, remove binaries and system files, and prompt for model deletion.

Guidance

  • For each operating system (macOS, Windows, Linux), there are specific manual teardown commands and automated scripts (uninstall-mac.sh, uninstall-windows.ps1, uninstall-linux.sh) provided to ensure a clean uninstallation of Ollama.
  • Before running the scripts, ensure you have the necessary permissions (e.g., Administrator on Windows, sudo on macOS and Linux).
  • The scripts will interactively ask if you want to keep or delete the downloaded models, allowing you to choose whether to retain or remove them.
  • After uninstallation, verify that Ollama has been completely removed by checking if the command ollama is still available in your terminal or command prompt.

Example

For macOS, you can use the uninstall-mac.sh script as follows:

chmod +x uninstall-mac.sh
./uninstall-mac.sh

This script will guide you through the uninstallation process, including stopping background processes, removing application files, and prompting for model deletion.

Notes

  • These scripts are designed for users who installed Ollama via the official download links or curl scripts. If you installed Ollama using a package manager, use the package manager's native uninstall commands instead.
  • Be cautious when deleting system files and models, as this action is irreversible.

Recommendation

Apply the workaround by using the provided uninstall scripts for your respective operating system, as they offer a safe and interactive way to uninstall Ollama and manage model data.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING