[PR #8733] [CLOSED] Add support for rootless local installation (--user flag) #11496

Closed
opened 2025-11-12 16:15:32 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/8733
Author: @rfievet
Created: 1/31/2025
Status: Closed

Base: mainHead: add-user-flag-on-install


📝 Commits (1)

  • d039243 Add support for rootless local installation (--user flag)

📊 Changes

1 file changed (+29 additions, -8 deletions)

View changed files

📝 scripts/install.sh (+29 -8)

📄 Description

Summary

This PR adds support for rootless installation using the --user flag, allowing users to install Ollama locally without requiring sudo access.

Changes Introduced

Added --user flag support:
Installs Ollama in ~/.local/bin instead of /usr/local/bin when --user is provided.
Skips sudo usage, allowing installation in restricted environments.
Updated directory creation logic:
Uses mkdir -p for ~/.local/bin when --user is set.
Uses sudo install for system-wide installs.

Usage Examples

System-wide install (default)

./install.sh

User-only install (without sudo)

./install.sh --user

Notable Change: adduser Is Skipped in Rootless Mode

Since rootless installation does not have sudo access, the script does not create the ollama system user in this mode.
Instead, Ollama runs as the current user when using --user.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/8733 **Author:** [@rfievet](https://github.com/rfievet) **Created:** 1/31/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `add-user-flag-on-install` --- ### 📝 Commits (1) - [`d039243`](https://github.com/ollama/ollama/commit/d0392433502a740887f78d28ad582255d9f3f77e) Add support for rootless local installation (--user flag) ### 📊 Changes **1 file changed** (+29 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `scripts/install.sh` (+29 -8) </details> ### 📄 Description ## Summary This PR adds support for rootless installation using the --user flag, allowing users to install Ollama locally without requiring sudo access. ## Changes Introduced ✅ Added --user flag support: Installs Ollama in ~/.local/bin instead of /usr/local/bin when --user is provided. Skips sudo usage, allowing installation in restricted environments. ✅ Updated directory creation logic: Uses mkdir -p for ~/.local/bin when --user is set. Uses sudo install for system-wide installs. ## Usage Examples ### System-wide install (default) `./install.sh` ### User-only install (without sudo) `./install.sh --user` ## Notable Change: adduser Is Skipped in Rootless Mode Since rootless installation does not have sudo access, the script does not create the ollama system user in this mode. Instead, Ollama runs as the current user when using --user. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-12 16:15:32 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama-ollama#11496