Unable to install prereqs

I am using the below link to install msbuild on Ubuntu 20.04 LTS in my environment.
https://github.com/actions/virtual-environments/blob/a8c8a73ad164f2128f3d3398165fb208d78474d4/images/linux/scripts/installers/mono.sh

I tried with both root and non-root users, but no luck. There are a few other tools also which are not getting installed from the below link. For example, brew.
https://github.com/actions/virtual-environments/blob/a8c8a73ad164f2128f3d3398165fb208d78474d4/images/linux/scripts/installers

Also, there are git.sh and haskell.sh scripts which I am calling from my Shell script. I also have an environment variable DEBIAN_FRONTEND declared in my Shell script. But I am not sure how to pass it to the scripts being called from my Shell script. The git and haskell scripts prompt and wait till an input is provided. I am not sure how to address these issues.

Has anyone else faced issues with the installation? Please help.