Eclipse mosquitto gives errors when apt upgrade invoked

I installed eclipse mosquitto in a container on an Rpi4B and it is working, can publish and subscribe. However, whenever I run sudo apt upgrade, I get this error report:

Reading package lists… Done
Building dependency tree
Reading state information… Done
Calculating upgrade… Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up mosquitto (1.5.7-1+deb10u1) …
Job for mosquitto.service failed because the control process exited with error code.
See “systemctl status mosquitto.service” and “journalctl -xe” for details.
invoke-rc.d: initscript mosquitto, action “start” failed.
● mosquitto.service - Mosquitto MQTT v3.1/v3.1.1 Broker
Loaded: loaded (/lib/systemd/system/mosquitto.service; disabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Thu 2022-06-02 07:47:19 MDT; 23ms ago
Docs: man:mosquitto.conf(5)
man:mosquitto(8)
Process: 2607 ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf (code=exited, status=1/FAILURE)
Main PID: 2607 (code=exited, status=1/FAILURE)
dpkg: error processing package mosquitto (–configure):
installed mosquitto package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
mosquitto
E: Sub-process /usr/bin/dpkg returned an error code (1)

I am using mosquitto version 1.5.7 and built the container this way:

sudo docker run -itd
–name=mqtt
–restart=always
–net=host
-v /mosquitto/config:/mosquitto/config
-v /mosquitto/data:/mosquitto/data
-v /mosquitto/log:/mosquitto/log
eclipse-mosquitto

Is there a way to get rid of the apt upgrade error messages? Thanks for any help.

Where do you run this? In the container?

Thats not how containers work :slight_smile:

Instead you should check if there is a new version of the image, you can try to do an

docker pull eclipse-mosquitto

and see if it pull down anything, if it does, then you need to re-create your container

Thanks for the prompt reply. I run sudo apt update and sudo apt upgrade in a regular terminal window and get that error. The docker pull eclipse-mosquitto command tells me the my image is up to date for eclipse-mosquttto:latest.

When mosquitto is running in the container, you dont need it on the host.
I would simply delete it from the host if you dont plan on using it, but plan to use it in the container instead

I installed some other programs, including numpy, and it seems one of them could not see mosquitto running in the container and installed it in the host, getting errors. I decided to remove the container, and let it run on the host instead. It is working on my docker program homeassistant, so I will leave it like that. Thanks again; I am new to docker.