[PR #12455] docs, scripts: Prevent useradd(8) from failing on Fedora Silverblue #76120

Open
opened 2026-05-05 08:35:00 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/12455
Author: @debarshiray
Created: 9/30/2025
Status: 🔄 Open

Base: mainHead: wip/rishi/scripts-install.sh-ollama-home-ostree


📝 Commits (1)

  • 7536f69 docs, scripts: Prevent useradd(8) from failing on Fedora Silverblue

📊 Changes

3 files changed (+4 additions, -4 deletions)

View changed files

📝 docs/faq.md (+1 -1)
📝 docs/linux.md (+2 -2)
📝 scripts/install.sh (+1 -1)

📄 Description

On OSTree based operating systems like Fedora Siverblue [1], the /usr/share directory is part of the read-only /usr mount point. This causes the install.sh script to fail when adding the ollama user with its home directory at /usr/share/ollama, because useradd(8) is unable to create the directory:

  $ curl -fsSL https://ollama.com/install.sh | sh
  >>> Installing ollama to /usr/local
  >>> Downloading Linux amd64 bundle
  ######################################################### 100.0%
  >>> Creating ollama user...
  useradd: cannot create directory /usr/share/ollama
  >>> The Ollama API is now available at 127.0.0.1:11434.
  >>> Install complete. Run "ollama" from the command line.

The /var/lib directory is an alternative for this, because /var is a read-write mount point. eg., this is used by Geoclue [2] and the GNOME Display Manager [3] for their users' home directories on Linux distributions like Arch, Fedora and Ubuntu.

With this change the install.sh script is able to proceed further:

  $ sh scripts/install.sh
  >>> Installing ollama to /usr/local
  >>> Downloading Linux amd64 bundle
  ######################################################### 100.0%
  >>> Creating ollama user...
  >>> Adding ollama user to render group...
  >>> Adding ollama user to video group...
  >>> Adding current user to ollama group...
  >>> Creating ollama systemd service...
  >>> Enabling and starting ollama service...
  Created symlink
      '/etc/systemd/system/default.target.wants/ollama.service' →
      '/etc/systemd/system/ollama.service'.
  >>> The Ollama API is now available at 127.0.0.1:11434.
  >>> Install complete. Run "ollama" from the command line.
  WARNING: No NVIDIA/AMD GPU detected. Ollama will run in CPU-only mode.

The install.sh script is able to use /usr/local on Fedora Silverblue, because /usr/local is not considered part of the read-only OS image, and is a symbolic link to /var/usrlocal to make it read-write.

[1] https://fedoraproject.org/silverblue/

[2] https://gitlab.freedesktop.org/geoclue/geoclue/-/wikis/home

[3] https://wiki.gnome.org/Projects/GDM/


🔄 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/12455 **Author:** [@debarshiray](https://github.com/debarshiray) **Created:** 9/30/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `wip/rishi/scripts-install.sh-ollama-home-ostree` --- ### 📝 Commits (1) - [`7536f69`](https://github.com/ollama/ollama/commit/7536f697ab869f84458490c499a6c607c4a2a63d) docs, scripts: Prevent useradd(8) from failing on Fedora Silverblue ### 📊 Changes **3 files changed** (+4 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `docs/faq.md` (+1 -1) 📝 `docs/linux.md` (+2 -2) 📝 `scripts/install.sh` (+1 -1) </details> ### 📄 Description On OSTree based operating systems like Fedora Siverblue [1], the `/usr/share` directory is part of the read-only `/usr` mount point. This causes the `install.sh` script to fail when adding the `ollama` user with its home directory at `/usr/share/ollama`, because `useradd(8)` is unable to create the directory: ``` $ curl -fsSL https://ollama.com/install.sh | sh >>> Installing ollama to /usr/local >>> Downloading Linux amd64 bundle ######################################################### 100.0% >>> Creating ollama user... useradd: cannot create directory /usr/share/ollama >>> The Ollama API is now available at 127.0.0.1:11434. >>> Install complete. Run "ollama" from the command line. ``` The `/var/lib` directory is an alternative for this, because `/var` is a read-write mount point. eg., this is used by Geoclue [2] and the GNOME Display Manager [3] for their users' home directories on Linux distributions like Arch, Fedora and Ubuntu. With this change the `install.sh` script is able to proceed further: ``` $ sh scripts/install.sh >>> Installing ollama to /usr/local >>> Downloading Linux amd64 bundle ######################################################### 100.0% >>> Creating ollama user... >>> Adding ollama user to render group... >>> Adding ollama user to video group... >>> Adding current user to ollama group... >>> Creating ollama systemd service... >>> Enabling and starting ollama service... Created symlink '/etc/systemd/system/default.target.wants/ollama.service' → '/etc/systemd/system/ollama.service'. >>> The Ollama API is now available at 127.0.0.1:11434. >>> Install complete. Run "ollama" from the command line. WARNING: No NVIDIA/AMD GPU detected. Ollama will run in CPU-only mode. ``` The `install.sh` script is able to use `/usr/local` on Fedora Silverblue, because `/usr/local` is not considered part of the read-only OS image, and is a symbolic link to `/var/usrlocal` to make it read-write. [1] https://fedoraproject.org/silverblue/ [2] https://gitlab.freedesktop.org/geoclue/geoclue/-/wikis/home [3] https://wiki.gnome.org/Projects/GDM/ --- <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 2026-05-05 08:35:00 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#76120