Thank you werners. Just figured that out and had an init script to sort out the issue. Below steps helped me to solve the issue.
dbutils.fs.mkdirs("dbfs:/cluster-init/scripts/")
dbutils.fs.put("/cluster-init/scripts/libsndfile-install.sh","""
#!/bin/bash
apt-get --yes install libsndfile1
""", True)
and added init script for the cluster as
dbfs:/cluster-init/scripts/libsndfile-install.sh