i had the same issue and the workaround i tried was;
- in Azure DEvOps >> Space Game - web - Agent >> Project settings
- under Pipelines >> Agent pools
- select MyAgentPool
- select the Agents tab
- click on the New agent button
- select the Linux tab
- under x64, Create the agent
- check the version of the tar.gz file (ie. vsts-agent-linux-x64-<version>.tar.gz)
- in bash, set the value of the export AZP_AGENT_VERSION=<version>
- rerun sudo -E ./build-agent.sh
hope this helps.