2025年7月21日

ollam 升級記

 我原是用 Linux 一鍵安裝腳本 (未來,可考慮改用 watchover, see https://containrrr.dev/watchtower/)

curl -fsSL https://ollama.com/install.sh | sh

$ curl -fsSL https://ollama.com/install.sh | sh

>>> Cleaning up old version at /usr/local/lib/ollama

>>> Installing ollama to /usr/local

>>> Downloading Linux amd64 bundle

################################################# 100.0%

>>> 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.

>>> NVIDIA GPU installed.


升級後版本

$ ollama -v

ollama version is 0.9.6


==錯誤訊息處理==

後來 docker 壞了:

$ docker ps -a

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?


$ sudo systemctl start docker

Job for docker.service failed because the control process exited with error code.

See "systemctl status docker.service" and "journalctl -xe" for details.


$ sudo systemctl restart docker

Job for docker.service failed because the control process exited with error code.

See "systemctl status docker.service" and "journalctl -xe" for details.


$ sudo systemctl stop docker

$ sudo systemctl start docker

Job for docker.service failed because the control process exited with error code.

See "systemctl status docker.service" and "journalctl -xe" for details.


查看 docker 的狀態

$ sudo systemctl status docker

● docker.service - Docker Application Container Engine

     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)

     Active: failed (Result: exit-code) since Mon 2025-07-21 20:33:51 CST; 3min 49s ago

TriggeredBy: ● docker.socket

       Docs: https://docs.docker.com

    Process: 37893 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, statu>

   Main PID: 37893 (code=exited, status=1/FAILURE)


 7月 21 20:33:51 m5700 systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.

 7月 21 20:33:51 m5700 systemd[1]: Stopped Docker Application Container Engine.

 7月 21 20:33:51 m5700 systemd[1]: docker.service: Start request repeated too quickly.

 7月 21 20:33:51 m5700 systemd[1]: docker.service: Failed with result 'exit-code'.

 7月 21 20:33:51 m5700 systemd[1]: Failed to start Docker Application Container Engine.


表示已經存在的 process with PID 15156 造成問題

$ sudo dockerd

INFO[2025-07-21T20:37:48.793286382+08:00] Starting up                                  

failed to start daemon, ensure docker is not running or delete /var/run/docker.pid: process with PID 15156 is still running


查出和 dockerd 有關的 process 程序 PID 是 15156

$ sudo ps aux | grep dockerd

root       15155  0.0  0.0  22184  7852 ?        S    16:55   0:00 sudo dockerd

root       15156  1.0  0.1 3095760 96296 ?       Sl   16:55   2:32 dockerd

xxxxxx     40934  0.0  0.0  16824  4692 pts/3    S+   21:02   0:00 grep --color=auto dockerd


殺到程序

$ sudo kill -9 15156


再次查看,果然沒了

$ sudo ps aux | grep dockerd

xxxxxx     40983  0.0  0.0  16824  4592 pts/3    S+   21:03   0:00 grep --color=auto dockerd


重新啟動 docker

$ sudo systemctl stop docker

$ sudo systemctl start docker


再檢查 docker 運行中的 container,成功了!

$ docker ps -a

CONTAINER ID   IMAGE                                COMMAND           CREATED       STATUS                            PORTS     NAMES

ee715295265d   ghcr.io/open-webui/open-webui:main   "bash start.sh"   3 hours ago   Up 6 seconds (health: starting)             open-webui