Hassbian mosquitto_sub command not found

Hello There,
I am trying to subscribe to some topics so I can see RF signals sent to the OpenMqttGateway however every time I try and use the mosquitto_sub i am told that the command does not exist. I have mosquitto 3.1 running and functioning for other MQTT devices. I am running hassbian with HA 66.1
error message

-bash: mosquitto_sub: command not found

Any ideas what is going on?

You need to install mosquitto-clients

What do you mean? How do I do this?

In your terminal where you want to run mosquitto_sub, type:
sudo apt-get install mosquitto-clients

Ran that and got this

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
mosquitto-clients : Depends: libmosquitto1 (= 1.4.12-0mosquitto1) but it is not going to be installed
N: Ignoring file ‘pwfile’ in directory ‘/etc/apt/sources.list.d/’ as it has no filename extension
N: Ignoring file ‘mosquitto-stretch.list.5’ in directory ‘/etc/apt/sources.list.d/’ as it has an invalid filename extension
N: Ignoring file ‘mosquitto-stretch.list.7’ in directory ‘/etc/apt/sources.list.d/’ as it has an invalid filename extension
N: Ignoring file ‘mosquitto-stretch.list.6’ in directory ‘/etc/apt/sources.list.d/’ as it has an invalid filename extension
N: Ignoring file ‘mosquitto-stretch.list.10’ in directory ‘/etc/apt/sources.list.d/’ as it has an invalid filename extension
N: Ignoring file ‘mosquitto-stretch.list.3’ in directory ‘/etc/apt/sources.list.d/’ as it has an invalid filename extension
N: Ignoring file ‘mosquitto-stretch.list.1’ in directory ‘/etc/apt/sources.list.d/’ as it has an invalid filename extension
N: Ignoring file ‘mosquitto-stretch.list.9’ in directory ‘/etc/apt/sources.list.d/’ as it has an invalid filename extension
N: Ignoring file ‘mosquitto-stretch.list.8’ in directory ‘/etc/apt/sources.list.d/’ as it has an invalid filename extension
N: Ignoring file ‘mosquitto-stretch.list.11’ in directory ‘/etc/apt/sources.list.d/’ as it has an invalid filename extension
N: Ignoring file ‘mosquitto-stretch.list.2’ in directory ‘/etc/apt/sources.list.d/’ as it has an invalid filename extension
N: Ignoring file ‘mosquitto-stretch.list.4’ in directory ‘/etc/apt/sources.list.d/’ as it has an invalid filename extension

How did you install mosquitto 3.1?

Hmm, seems there are some problems witch stretch and mosquitto.
Maybe this helps.

Honestly I thought I used the config script but it’s been so long I can’t remember. I know that the config script has issues. I might just reinstall.

Here’s another topic about this:

Thanks I will look into this and let you know how it works

OK got it to install and now I can run mosquitto_sub commands, however HASS failed to set up mqtt.

OK wow, after a lot of trouble shooting I came to realize that during the install I miss typed my password. After a reinstall and putting in my password slowly all works. Thanks for your help @VDRainer

1 Like