[GH-ISSUE #13940] Linux: automatic update. #9122

Open
opened 2026-04-12 21:58:42 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @schoenid on GitHub (Jan 27, 2026).
Original GitHub issue: https://github.com/ollama/ollama/issues/13940

There is no automatic update for Linux.
It should be easy, to add it to the installation script.

I've created my own script for an update, first of all a simple update procedure, if a newer version is available:

#!/bin/bash

# Aktuelle Version ermitteln (entfernt 'v' Präfix falls vorhanden)
current_version=$(ollama -v | awk '{print $NF}' | sed 's/^v//')

# Neueste Version von GitHub abrufen
latest_version=$(curl -s https://api.github.com/repos/ollama/ollama/releases/latest | grep -Po '"tag_name": "v\K[^"]*')

if [ "$current_version" != "$latest_version" ]; then
    echo "Update verfügbar: $current_version -> $latest_version"
    # Automatisch aktualisieren durch erneutes Ausführen des Install-Scripts
    curl -fsSL https://ollama.com/install.sh | sh
else
    echo "Ollama ist auf dem neuesten Stand ($current_version)."
fi

This should be placed as /usr/local/bin/ollama-update.sh.
Maybe this is required too:

sudo chown root:root /usr/local/bin/ollama-update.sh
sudo chmod +x /usr/local/bin/ollama-update.sh

It can then be called with: sudo ollama-update.sh

To keep it simple, I configured a system service to check on every system start, whether an update is required:

[Unit]
Description=Ollama Update Check
After=network-online.target
Requires=network-online.target

[Service]
ExecStart=/usr/local/bin/ollama-update.sh
Type=oneshot
RemainAfterExit=no

[Install]
WantedBy=multi-user.target

It should be placed on: /etc/systemd/system/ollama-update.service

Enable the service with:

sudo systemctl daemon-reload
sudo systemctl enable ollama-update.service

Now on every system start, the update will be done automatically.

To check it, you could use: journalctl -u ollama-update.service

It is possible, to add some timers to the system service, to check regularely for updates.
For me it's enough, to do it on every system start, so I did not figure out, how to do it.
For servers with long run times it would be required, to use timers.

If a version of ollama should be kept, simply disable the service with:
sudo systemctl disble ollama-update.service.
(Don't forget to enable it later again ...)

My system:
Operating System: Ubuntu Studio 24.04
KDE Plasma Version: 5.27.12
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.13
Kernel Version: 6.14.0-37-generic (64-bit)
Graphics Platform: X11
Processors: 16 × 13th Gen Intel® Core™ i7-13700K
Memory: 62.5 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 4060 Ti/PCIe/SSE2
Manufacturer: ASUS

Have fun ...

Originally created by @schoenid on GitHub (Jan 27, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/13940 There is no automatic update for Linux. It should be easy, to add it to the installation script. I've created my own script for an update, first of all a simple update procedure, if a newer version is available: ``` #!/bin/bash # Aktuelle Version ermitteln (entfernt 'v' Präfix falls vorhanden) current_version=$(ollama -v | awk '{print $NF}' | sed 's/^v//') # Neueste Version von GitHub abrufen latest_version=$(curl -s https://api.github.com/repos/ollama/ollama/releases/latest | grep -Po '"tag_name": "v\K[^"]*') if [ "$current_version" != "$latest_version" ]; then echo "Update verfügbar: $current_version -> $latest_version" # Automatisch aktualisieren durch erneutes Ausführen des Install-Scripts curl -fsSL https://ollama.com/install.sh | sh else echo "Ollama ist auf dem neuesten Stand ($current_version)." fi ``` This should be placed as `/usr/local/bin/ollama-update.sh`. Maybe this is required too: ``` sudo chown root:root /usr/local/bin/ollama-update.sh sudo chmod +x /usr/local/bin/ollama-update.sh ``` It can then be called with: `sudo ollama-update.sh` To keep it simple, I configured a system service to check on every system start, whether an update is required: ``` [Unit] Description=Ollama Update Check After=network-online.target Requires=network-online.target [Service] ExecStart=/usr/local/bin/ollama-update.sh Type=oneshot RemainAfterExit=no [Install] WantedBy=multi-user.target ``` It should be placed on: `/etc/systemd/system/ollama-update.service` Enable the service with: ``` sudo systemctl daemon-reload sudo systemctl enable ollama-update.service ``` Now on every system start, the update will be done automatically. To check it, you could use: `journalctl -u ollama-update.service` It is possible, to add some timers to the system service, to check regularely for updates. For me it's enough, to do it on every system start, so I did not figure out, how to do it. For servers with long run times it would be required, to use timers. If a version of ollama should be kept, simply disable the service with: `sudo systemctl disble ollama-update.service`. (Don't forget to enable it later again ...) My system: Operating System: Ubuntu Studio 24.04 KDE Plasma Version: 5.27.12 KDE Frameworks Version: 5.115.0 Qt Version: 5.15.13 Kernel Version: 6.14.0-37-generic (64-bit) Graphics Platform: X11 Processors: 16 × 13th Gen Intel® Core™ i7-13700K Memory: 62.5 GiB of RAM Graphics Processor: NVIDIA GeForce RTX 4060 Ti/PCIe/SSE2 Manufacturer: ASUS Have fun ...
GiteaMirror added the feature request label 2026-04-12 21:58:42 -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#9122