How To Install mosquitto on AlmaLinux 8

In this tutorial we learn how to install mosquitto in AlmaLinux 8. mosquitto is An Open Source MQTT v3.1/v3.1.1 Broker

Introduction

In this tutorial we learn how to install mosquitto on AlmaLinux 8.

What is mosquitto

Mosquitto is an open source message broker that implements the MQ Telemetry Transport protocol version 3.1 and 3.1.1 MQTT provides a lightweight method of carrying out messaging using a publish/subscribe model. This makes it suitable for “machine to machine” messaging such as with low power sensors or mobile devices such as phones, embedded computers or micro-controllers like the Arduino.

We can use yum or dnf to install mosquitto on AlmaLinux 8. In this tutorial we discuss both methods but you only need to choose one of method to install mosquitto.

Install mosquitto on AlmaLinux 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

After updating yum database, We can install mosquitto using dnf by running the following command:

sudo dnf -y install mosquitto

Install mosquitto on AlmaLinux 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

After updating yum database, We can install mosquitto using yum by running the following command:

sudo yum -y install mosquitto

How To Uninstall mosquitto on AlmaLinux 8

To uninstall only the mosquitto package we can use the following command:

sudo dnf remove mosquitto

References

Summary

In this tutorial we learn how to install mosquitto on AlmaLinux 8 using yum and dnf.