There’s been a previous thread on this problem.
You can try making a temporary directory in your home folder where you have write permission
There was also a question why was using the musl version
It might also be due to having a snap version of curl (why I don’t use Ubuntu anymore, I hate being forced to use snaps)