interestingly, you are root and calling a script with sudo. i wonder why...
if that is a normal desktop install and you have to use root instead of a user to clone a repository, then something is wrong for sure. i would investigate and solve the issue, and not work around it.