ollama - ✅(Solved) Fix Docs: Linux uninstall command uses `tr 'bin' 'lib'`, which mangles paths [1 pull requests, 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#14931Fetched 2026-04-08 00:57:24
View on GitHub
Comments
0
Participants
1
Timeline
8
Reactions
0
Author
Participants
Timeline (top)
referenced ×4cross-referenced ×3labeled ×1

Fix Action

Fixed

PR fix notes

PR #14934: docs: fix Linux uninstall command path mangling

Description (problem / solution / changelog)

Fixes #14931

Changed files

  • docs/linux.mdx (modified, +1/-1)

Code Example

Remove ollama libraries from your lib directory (either /usr/local/lib, /usr/lib, or /lib):

sudo rm -r $(which ollama | tr 'bin' 'lib')

---

$ which ollama | tr 'bin' 'lib'
/sbap/lib/ollama

---
RAW_BUFFERClick to expand / collapse

What is the issue?

The tr command performs character-by-character translation, so this is wrong:

 Remove ollama libraries from your lib directory (either /usr/local/lib, /usr/lib, or /lib):

sudo rm -r $(which ollama | tr 'bin' 'lib')

Example with a snap (just to prove the point)

$ which ollama | tr 'bin' 'lib'
/sbap/lib/ollama

Relevant log output

OS

No response

GPU

No response

CPU

No response

Ollama version

No response

extent analysis

Fix Plan

The issue can be fixed by using parameter expansion instead of the tr command to replace the 'bin' directory with 'lib'.

Step-by-Step Solution

  • Use parameter expansion to replace 'bin' with 'lib' in the path:
sudo rm -r "${OLLAMA_PATH//bin/lib}"

However, since which ollama is used to get the path, we can modify it as follows:

OLLAMA_PATH=$(which ollama)
sudo rm -r "${OLLAMA_PATH//bin/lib}"

Or in one line:

sudo rm -r "$(which ollama | sed 's/bin/lib/')"

Using sed is a more straightforward approach for this specific case.

Verification

To verify the fix, you can run the command without the sudo rm -r part to see the resulting path:

which ollama | sed 's/bin/lib/'

This should output the correct path to the library directory.

Extra Tips

  • Be cautious when using sudo rm -r as it can permanently delete files and directories.
  • Always verify the path before running the removal command to avoid accidental deletions.

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

ollama - ✅(Solved) Fix Docs: Linux uninstall command uses `tr 'bin' 'lib'`, which mangles paths [1 pull requests, 1 participants]