[GH-ISSUE #8389] Ollama install script relaces the systemd profile #31145

Closed
opened 2026-04-22 11:19:59 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @gerroon on GitHub (Jan 12, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/8389

What is the issue?

The installation script doesn't pay attention to existing systemd profile, so every new install will replace the existing systemd script. This is not the standard behavior in Debian or other distros, the script at least should ask for permission to replace it.

This is the recommend script
curl https://ollama.ai/install.sh | sh

https://github.com/ollama/ollama/blob/main/docs/faq.md

It replaces
/etc/systemd/system/ollama.service

OS

Linux

GPU

Nvidia

CPU

Intel

Ollama version

0.5.4

Originally created by @gerroon on GitHub (Jan 12, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/8389 ### What is the issue? The installation script doesn't pay attention to existing systemd profile, so every new install will replace the existing systemd script. This is not the standard behavior in Debian or other distros, the script at least should ask for permission to replace it. This is the recommend script `curl https://ollama.ai/install.sh | sh ` https://github.com/ollama/ollama/blob/main/docs/faq.md It replaces `/etc/systemd/system/ollama.service` ### OS Linux ### GPU Nvidia ### CPU Intel ### Ollama version 0.5.4
GiteaMirror added the bug label 2026-04-22 11:19:59 -05:00
Author
Owner

@rick-github commented on GitHub (Jan 12, 2025):

Add your custom settings with sudo systemctl edit ollama. This will put them in an overrides file which is preserved during upgrade.

<!-- gh-comment-id:2585549490 --> @rick-github commented on GitHub (Jan 12, 2025): Add your custom settings with `sudo systemctl edit ollama`. This will put them in an overrides file which is preserved during upgrade.
Author
Owner

@gerroon commented on GitHub (Jan 12, 2025):

Add your custom settings with sudo systemctl edit ollama. This will put them in an overrides file which is preserved during upgrade.

Sure I know that. I am just pointing that it shouldn't just replace it.

<!-- gh-comment-id:2585562517 --> @gerroon commented on GitHub (Jan 12, 2025): > Add your custom settings with `sudo systemctl edit ollama`. This will put them in an overrides file which is preserved during upgrade. Sure I know that. I am just pointing that it shouldn't just replace it.
Author
Owner

@rick-github commented on GitHub (Jan 12, 2025):

How is it going to upgrade the package if it can't replace files?

<!-- gh-comment-id:2585587349 --> @rick-github commented on GitHub (Jan 12, 2025): How is it going to upgrade the package if it can't replace files?
Author
Owner

@gerroon commented on GitHub (Jan 12, 2025):

Systemd profiles aren't really updated that frequently. Even if they do they should update it only when the Systemd file is updated. Ollama's install script replaces the systemd file whether there was a real upgrade or not, it just does it by default. I can run the Ollama script multiple times in a minute and everytime it just copies a fresh one.

<!-- gh-comment-id:2585588143 --> @gerroon commented on GitHub (Jan 12, 2025): Systemd profiles aren't really updated that frequently. Even if they do they should update it only when the Systemd file is updated. Ollama's install script replaces the systemd file whether there was a real upgrade or not, it just does it by default. I can run the Ollama script multiple times in a minute and everytime it just copies a fresh one.
Author
Owner

@rick-github commented on GitHub (Jan 12, 2025):

A fresh one that's the same as the one that was there before. I'm not sure I understand the problem.

<!-- gh-comment-id:2585592638 --> @rick-github commented on GitHub (Jan 12, 2025): A fresh one that's the same as the one that was there before. I'm not sure I understand the problem.
Author
Owner

@gerroon commented on GitHub (Jan 12, 2025):

What the script does isn't a standard distro behavior that is my argument. It shouldn't override the existing systemd files unless there is an actual sytemd config update with Ollama. The current script acts like Ollama was never installed on the system, even though it has been installed on the system.

<!-- gh-comment-id:2585594289 --> @gerroon commented on GitHub (Jan 12, 2025): What the script does isn't a standard distro behavior that is my argument. It shouldn't override the existing systemd files unless there is an actual sytemd config update with Ollama. The current script acts like Ollama was never installed on the system, even though it has been installed on the system.
Author
Owner

@kha84 commented on GitHub (Jan 19, 2025):

I back this. I just figured, that whatever env environment variables I was adding to original systemd unit file are now gone after upgrade as they were replaced with vanilla file. It's inconvenient. Ideally installer script should mimic what package managers do when the upgrade happens - respect existing changes made by user

<!-- gh-comment-id:2600905601 --> @kha84 commented on GitHub (Jan 19, 2025): I back this. I just figured, that whatever env environment variables I was adding to original systemd unit file are now gone after upgrade as they were replaced with vanilla file. It's inconvenient. Ideally installer script should mimic what package managers do when the upgrade happens - respect existing changes made by user
Author
Owner

@rick-github commented on GitHub (Jan 19, 2025):

It works if you follow the instructions.

https://github.com/ollama/ollama/blob/main/docs/faq.md#setting-environment-variables-on-linux

<!-- gh-comment-id:2600915445 --> @rick-github commented on GitHub (Jan 19, 2025): It works if you follow the instructions. https://github.com/ollama/ollama/blob/main/docs/faq.md#setting-environment-variables-on-linux
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#31145