3

Right now I have 1.3.4 Mosquitto Version installed from the repository on my PI. Current version is 1.4.15. So, how do I go about upgrading my Mosquitto MQTT to the latest version on my PI? I looked around on the Internet, but I can't seem to really find any information. I also checked the PI's repository and it only has 1.3 version. Any help will be appreciated. Thanks.

1
  • I was going to recommend adding the http://repo.mosquitto.org/debian repo to apt - however, a recent update broke mosquitto, at least on raspberry pi 1 (stretch) - it may work on rpi-3 (jessie I guess, since you should be able to get 1.4.10 in stretch) - you could always try :p Mar 8, 2018 at 1:06

2 Answers 2

2

I'm guessing you're running Raspbian Jessie, which only has Mosquitto 1.3.4 in the repositories. Raspbian Stretch does indeed have a more recent version — 1.4.10.

If this would be sufficient, you can just flash a new Raspbian Stretch image on to your SD card and install Mosquitto. Note that the Pi Foundation suggest using a new image rather than upgrading with your package manager, although that may work despite the warnings. Be aware that flashing a new image will of course delete all of your files.

Otherwise, you may need to build the latest version from source:

Building from source

To build from source the recommended route for end users is to download the archive from http://mosquitto.org/download/.

On Windows and Mac, use cmake to build. On other platforms, just run make to build. For Windows, see also readme-windows.md.

If you are building from the git repository then the documentation will not already be built. Use make binary to skip building the man pages, or install docbook-xsl on Debian/Ubuntu systems.

Build Dependencies

  • c-ares (libc-ares-dev on Debian based systems) - disable with make WITH_SRV=no
  • libuuid (uuid-dev) - disable with make WITH_UUID=no
  • libwebsockets (libwebsockets-dev) - enable with make WITH_WEBSOCKETS=yes
  • openssl (libssl-dev on Debian based systems) - disable with make WITH_TLS=no
  • xsltproc (xsltproc and docbook-xsl on Debian based systems) - only needed when building from git sources - disable with make WITH_DOCS=no

It doesn't look like Mosquitto is available from the backports repository, so you're limited to compiling it yourself, I would think.

4
  • there is 1.4.15 on http://repo.mosquitto.org/debian - but, there may be an issue at least with "stretch" version at least on RPi-1 - have not tried on my RPi-3 at all Mar 8, 2018 at 1:15
  • I downloaded and installed Raspbian Stretch, but my software didn't work right, which means side tracking and troubleshooting why and how to fix it that. Being that I am under time constraint, I can't do that. So, I downloaded the Mosquitto Package from the link you provided and attempted to install it on Raspbian Jessie and it is complaining that there are issues with the files that it is trying to COMPILE and quits without installing Mosquitto. I am not sure what to do next. I am using PI3.
    – ThN
    Mar 8, 2018 at 17:18
  • Does it give you a more specific error message? If so, you should probably search that and if there's nothing you can find about it, ask a new question here and I'll take a look for you in case I can help.
    – Aurora0001
    Mar 8, 2018 at 18:54
  • If anyone runs into ssl error messages right after make, then it is worth looking at this related question. stackoverflow.com/questions/34152936/…. It helped me successfully install the latest Mosquitto Broker. Thanks.
    – ThN
    Mar 13, 2018 at 14:35
2

I searched online high and low and came across this webpage on Mosquitto.org website. Link to where I found information on upgrading Mosquitto

I am going to post what I found and how I upgraded mosquitto in case that webpage disappears. Do the following.

To use the new repository you should first import the repository package signing key:

wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
sudo apt-key add mosquitto-repo.gpg.key

Then make the repository available to apt:

cd /etc/apt/sources.list.d/

Then one of the following, depending on which version of debian you are using:

sudo wget http://repo.mosquitto.org/debian/mosquitto-wheezy.list
sudo wget http://repo.mosquitto.org/debian/mosquitto-jessie.list
sudo wget http://repo.mosquitto.org/debian/mosquitto-stretch.list

Then update apt information:

sudo apt-get update

And discover what mosquitto packages are available:

sudo apt-cache search mosquitto

Or just install or upgrade:

sudo apt-get install mosquitto

Finally install the Mosquitto Clients:

sudo apt-get install mosquitto-clients

This worked for me. The reason I wanted to upgrade to the latest Mosquitto MQTT was because I having problems and issues running Mosquitto 1.3. Clients kept loosing connection to the broker. Hopefully, this upgrade fixes that. Thank for your help.

2
  • Is this applicable in case of Ubuntu as well.?
    – S Andrew
    May 21, 2021 at 2:10
  • @SAndrew I did this upgrade on Raspberry PI Raspbien OS. I suppose you should be able to do the same on Ubuntu just as long as you are able to run these commands on your Terminal.
    – ThN
    May 28, 2021 at 16:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.