Skip to content

Conversation

@debarshiray
Copy link

@debarshiray debarshiray commented Sep 30, 2025

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/

debarshiray added a commit to debarshiray/ollama that referenced this pull request Sep 30, 2025
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.

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/

ollama#12455
@debarshiray debarshiray force-pushed the wip/rishi/scripts-install.sh-ollama-home-ostree branch from 19a8c2f to 9370ad2 Compare September 30, 2025 14:03
@debarshiray debarshiray marked this pull request as draft September 30, 2025 14:13
debarshiray added a commit to debarshiray/ollama that referenced this pull request Sep 30, 2025
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/

ollama#12455
@debarshiray debarshiray force-pushed the wip/rishi/scripts-install.sh-ollama-home-ostree branch from 9370ad2 to 34d917b Compare September 30, 2025 14:21
@debarshiray debarshiray marked this pull request as ready for review September 30, 2025 14:26
@debarshiray debarshiray force-pushed the wip/rishi/scripts-install.sh-ollama-home-ostree branch from 34d917b to 83031dc Compare September 30, 2025 20:22
debarshiray added a commit to debarshiray/ollama that referenced this pull request Sep 30, 2025
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/

ollama#12455
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/

ollama#12455
@debarshiray debarshiray force-pushed the wip/rishi/scripts-install.sh-ollama-home-ostree branch from 83031dc to 7536f69 Compare September 30, 2025 20:27
@debarshiray debarshiray changed the title scripts: Prevent useradd(8) from failing on Fedora Silverblue docs, scripts: Prevent useradd(8) from failing on Fedora Silverblue Sep 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant