We have already described the mosquitto brokers installation in Ubuntu and Debian system, this post is installed mosquitto broker automatically by the simple shell script.
#Install dependancy packages
sudo apt-get update -y
sudo apt-get install git cmake build-essential python quilt devscripts python-setuptools python3 libssl-dev gdb daemon uuid-dev libc-ares-dev -y
apt-get remove mosquitto -y
#Extract Mosquitto Package
tar -zxvf mosquitto-1.4.8.tar.gz
ln -s /usr/local/sbin/mosquitto /usr/sbin/mosquitto
service mosquitto start
#Check your mosquitto port number,
netstat -anp | grep 1883
echo "Now the mosquitto broker is running..."
Create a file with .sh extension and paste the above lines into it.
$ vim mosquitto-install.sh
provide execute permission,
$ chmod +x mosquitto-install.sh
Now, run this file,
Execute in your current directory