Unable to locate executable file: ‘mono’ Azure Deveops Pipeline

Error:

##[error]Error: Unable to locate executable file: 'mono'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.
##[error]Packages failed to restore

The solution is to install mono on Ubuntu. The steps to install mono on Ubuntu has been mentioned here:

After installing the mono the Azure Devops pipeline will not acomplain about that error.