Portainer update

i know that updating portainer should be done with “dietpi-software reinstall 185”
but this only leads to an error that the container “portainer” is still in use and cannot be removed.

stopping it from a secondary session prints out the container name but has no effect on the update script.

i’m running DietPi v9.10.0
portainer shows “2.20.3”

the github page of portainer shows Release Release 2.21.5 · portainer/portainer · GitHub as latest.

how am i gonna update now?

In my installation(s) the update works.
Maybe a
docker stop portainer
before helps?
Or a
systemctl stop docker
or a
service docker stop
(don’t forget the start afterwards).

Did you run it as root? (with sudo in front of the command)
I tried it and it stops the docker before proceeding with the reinstall.

root@raspi4b:[~]$ dietpi-software reinstall 185
[  OK  ] DietPi-Software | Initialised database
[  OK  ] DietPi-Software | Reading database

 DietPi-Software
─────────────────────────────────────────────────────
 Mode: Automated reinstall

[  OK  ] DietPi-Software | Reinstalling Portainer: Simplifies container management in Docker (standalone host)
[  OK  ] DietPi-Software | DietPi-Userdata validation: /mnt/dietpi_userdata

 DietPi-Software
─────────────────────────────────────────────────────
 Step: Checking for conflicts and missing inputs


 DietPi-Software
─────────────────────────────────────────────────────
 Step: Checking for prerequisite software

[ INFO ] DietPi-Software | Docker will be reinstalled
[  OK  ] DietPi-Software | mkdir -p /mnt/dietpi_userdata/Music /mnt/dietpi_userdata/Pictures /mnt/dietpi_userdata/Video /mnt/dietpi_userdata/downloads /var/www /opt /usr/local/bin
[  OK  ] DietPi-Software | chown dietpi:dietpi /mnt/dietpi_userdata/Music /mnt/dietpi_userdata/Pictures /mnt/dietpi_userdata/Video /mnt/dietpi_userdata/downloads
[  OK  ] DietPi-Software | chmod 0775 /mnt/dietpi_userdata/Music /mnt/dietpi_userdata/Pictures /mnt/dietpi_userdata/Video /mnt/dietpi_userdata/downloads
[ SUB1 ] DietPi-Services > stop 
[  OK  ] DietPi-Services | stop : cron
[  OK  ] DietPi-Services | stop : docker
[  OK  ] DietPi-Services | stop : rpimonitor
...

Otherwise dietpi-services stop docker should also do the trick before the dietpi-software reinstall 185

1 Like

Yes, I ran it as root.

didn’t work for me.
it cannot stop the container …

now 2.27.0 is out Release Release 2.27.0 · portainer/portainer · GitHub marked as latest

Error response from daemon: conflict: unable to delete 3255108e46a0 (cannot be forced) - image is being used by running container 94589cdd1a09

Does a dietpi-software uninstall 185 with a following dietpi-software install 185 work?

Does a dietpi-software uninstall 185 with a following dietpi-software install 185 work?

Error response from daemon: conflict: unable to delete 3255108e46a0 (cannot be forced) - image is being used by running container 94589cdd1a09

(My installation was updatable like the one from trendy shown above)
Maybe a kill of the portainer process helps?
´ps -ef | grep portainer Then find out the pid of portainer and do akill -9 <portainer_pid>`
After this try to reinstall it.

Hope this helps. :thinking:

I know we had some rare cases where stopping the container was not possible because they got automatically restarted by Docker itself each time we tried to stop them

Could this be solved by temporary changing the restart policies?
image

I never tested this.

My example above is with always restart policy.

@michapixel please post the whole output from the dietpi-reinstall as I did above.
Also you didn’t fill in the initial troubleshooting form, therefore please do so, so we know platform etc.

1 Like
#### Details:
- Date           | 2025-02-21 15:53:56
- Program name   | DietPi-Software
- Command        | `docker image rm 3255108e46a0`
- Exit code      | 1
- DietPi version | v9.10.0 (MichaIng/master)
- Distro version | bookworm (ID=7)
- Kernel version | `Linux ryzen 6.1.0-31-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.128-1 (2025-02-07) x86_64 GNU/Linux`
- Architecture   | `amd64`
- Hardware model | Native PC (x86_64) (ID=21)
- Power supply   | (EG: RAVPower 5V 1A)
- SD card        | (EG: SanDisk Ultra 16 GB)
#### Steps to reproduce:
<!-- Explain how to reproduce the issue -->
1. ...
2. ...
#### Expected behaviour:
<!-- What SHOULD happen? -->
- ...
#### Actual behaviour:
<!-- What IS happening? -->
- ...
#### Extra details:
<!-- Please post any extra details that might help solve the issue -->
- ...
#### Additional logs:

Error response from daemon: conflict: unable to delete 3255108e46a0 (cannot be forced) - image is being used by running container 94589cdd1a09

root@ryzen:~# dietpi-software reinstall 185
[  OK  ] DietPi-Software | Initialised database
[  OK  ] DietPi-Software | Reading database

 DietPi-Software
─────────────────────────────────────────────────────
 Mode: Automated reinstall

[  OK  ] DietPi-Software | Reinstalling Portainer: Simplifies container management in Docker (standalone host)
[ SUB1 ] DietPi-Backup > Backup
[ INFO ] DietPi-Backup | Rotating backup archive
[  OK  ] DietPi-Backup | mv /mnt/nvme2text/dietpi-backup/data_2 /mnt/nvme2text/dietpi-backup/data_tmp
[  OK  ] DietPi-Backup | mv /mnt/nvme2text/dietpi-backup/data /mnt/nvme2text/dietpi-backup/data_2
[  OK  ] DietPi-Backup | mv /mnt/nvme2text/dietpi-backup/data_tmp /mnt/nvme2text/dietpi-backup/data
[ SUB2 ] DietPi-Services > stop
[  OK  ] DietPi-Services | stop : cron
[  OK  ] DietPi-Services | stop : docker
[  OK  ] DietPi-Services | stop : avahi-daemon
[ INFO ] DietPi-Backup | Checking for required APT packages: rsync
[ INFO ] DietPi-Backup | Checking for sufficient disk space via rsync dry-run, please wait...
[  OK  ] DietPi-Backup | Free space check: path=/mnt/nvme2text/dietpi-backup/data | available=775094 MiB | required=1881 MiB
[ INFO ] DietPi-Backup | Backup to /mnt/nvme2text/dietpi-backup in progress, please wait...
sending incremental file list

{ --------- long list of backup/rsync output ------------}

[  OK  ] DietPi-Backup | cp -a /etc/debian_version /mnt/nvme2text/dietpi-backup/data/etc/debian_version
[  OK  ] DietPi-Backup | touch /mnt/nvme2text/dietpi-backup/data
[ SUB2 ] DietPi-Services > start
[  OK  ] DietPi-Services | start : avahi-daemon
[  OK  ] DietPi-Services | start : docker
[  OK  ] DietPi-Services | start : cron
[  OK  ] DietPi-Backup: Backup | Completed
[  OK  ] DietPi-Backup | Completed
[  OK  ] DietPi-Software | DietPi-Userdata validation: /mnt/dietpi_userdata

 DietPi-Software
─────────────────────────────────────────────────────
 Step: Checking for conflicts and missing inputs


 DietPi-Software
─────────────────────────────────────────────────────
 Step: Checking for prerequisite software

[ INFO ] DietPi-Software | Docker will be reinstalled
[  OK  ] DietPi-Software | mkdir -p /mnt/dietpi_userdata/Music /mnt/dietpi_userdata/Pictures /mnt/dietpi_userdata/Video /mnt/dietpi_userdata/downloads /var/www /opt /usr/local/bin
[  OK  ] DietPi-Software | chown dietpi:dietpi /mnt/dietpi_userdata/Music /mnt/dietpi_userdata/Pictures /mnt/dietpi_userdata/Video /mnt/dietpi_userdata/downloads
[  OK  ] DietPi-Software | chmod 0775 /mnt/dietpi_userdata/Music /mnt/dietpi_userdata/Pictures /mnt/dietpi_userdata/Video /mnt/dietpi_userdata/downloads
[ SUB1 ] DietPi-Services > stop
[  OK  ] DietPi-Services | stop : cron
[  OK  ] DietPi-Services | stop : docker
[  OK  ] DietPi-Services | stop : avahi-daemon
[ INFO ] DietPi-Software | APT update, please wait...
Hit:1 https://download.docker.com/linux/debian bookworm InRelease
Hit:2 https://deb.debian.org/debian bookworm InRelease
Get:3 https://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]
Get:4 https://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]
Get:5 https://deb.debian.org/debian bookworm-backports InRelease [59.0 kB]
Get:6 https://deb.debian.org/debian-security bookworm-security/main amd64 Packages [246 kB]
Get:7 https://deb.debian.org/debian bookworm-backports/main amd64 Packages.diff/Index [63.3 kB]
Get:8 https://deb.debian.org/debian bookworm-backports/main amd64 Packages T-2025-02-21-0817.39-F-2025-02-21-0817.39.pdiff [463 B]
Get:8 https://deb.debian.org/debian bookworm-backports/main amd64 Packages T-2025-02-21-0817.39-F-2025-02-21-0817.39.pdiff [463 B]
Hit:9 https://dietpi.com/apt bookworm InRelease
Fetched 472 kB in 1s (510 kB/s)
Reading package lists...
[  OK  ] DietPi-Software | APT update

 DietPi-Software
─────────────────────────────────────────────────────
 Step: Installing Docker: Build, ship, and run distributed applications

[  OK  ] DietPi-Software | Checking URL: https://download.docker.com/linux/debian/gpg
[  OK  ] DietPi-Software | eval curl -sSfL 'https://download.docker.com/linux/debian/gpg' | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-docker.gpg --yes
[  OK  ] DietPi-Software | eval echo 'deb https://download.docker.com/linux/debian bookworm stable' > /etc/apt/sources.list.d/docker.list
[ INFO ] DietPi-Software | APT update, please wait...
Hit:1 https://download.docker.com/linux/debian bookworm InRelease
Hit:2 https://deb.debian.org/debian bookworm InRelease
Hit:3 https://deb.debian.org/debian bookworm-updates InRelease
Hit:4 https://deb.debian.org/debian-security bookworm-security InRelease
Hit:5 https://deb.debian.org/debian bookworm-backports InRelease
Hit:6 https://dietpi.com/apt bookworm InRelease
Reading package lists...
[  OK  ] DietPi-Software | APT update
[  OK  ] DietPi-Software | systemctl mask --now docker
[ INFO ] DietPi-Software | APT install docker-ce, please wait...
Reading package lists...
Building dependency tree...
Reading state information...
docker-ce is already the newest version (5:28.0.0-1~debian.12~bookworm).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[  OK  ] DietPi-Software | APT install docker-ce
[  OK  ] DietPi-Software | systemctl unmask docker
[  OK  ] DietPi-Software | systemctl start docker.socket
[  OK  ] DietPi-Software | mkdir -p /lib/systemd/system/docker.service.d
[  OK  ] DietPi-Software | eval echo -e '[Service]\nType=simple' > /lib/systemd/system/docker.service.d/dietpi-simple.conf
[  OK  ] DietPi-Software | mkdir -p /mnt/dietpi_userdata/docker-data
[  OK  ] DietPi-Software | Current setting in /etc/docker/daemon.json will be preserved:     "data-root": "/mnt/dietpi_userdata/docker-data",
[  OK  ] DietPi-Software | Current setting in /etc/docker/daemon.json will be preserved:     "log-driver": "journald",
[  OK  ] DietPi-Software | Current setting in /etc/docker/daemon.json will be preserved:     "log-level": "warn",
[  OK  ] DietPi-Software | Current setting in /etc/docker/daemon.json will be preserved:     "debug": false
[  OK  ] DietPi-Software | Desired setting in /etc/containerd/config.toml was already set: [debug]
[  OK  ] DietPi-Software | Current setting in /etc/containerd/config.toml will be preserved:   level = "warn"
[  OK  ] DietPi-Software | update-alternatives --set iptables /usr/sbin/iptables-nft
[  OK  ] DietPi-Software | update-alternatives --set ip6tables /usr/sbin/ip6tables-nft

 DietPi-Software
─────────────────────────────────────────────────────
 Step: Installing Portainer: Simplifies container management in Docker (standalone host)

[.     ]Error response from daemon: conflict: unable to delete 3255108e46a0 (cannot be forced) - image is being used by running container 94589cdd1a09

i cannot edit portainer settings of portainer itself, which makes sense to me.

you can try to stop Portainer container manually from command line. I guess it will be restarted Docker quickly. You can check it all manually without the need to using dietpi-software

how?

i mean dietpi-software is in the end using some bash commands, and if those - evene - sometimes fail, and if there’s some other that won’t, why not use those in dietpi-software … ?