Just got hit by the same issue in a VM after a fresh install of 20.04.5. I chose ”Minimal installation”, ticked ”Download updates while installing”, and installed the remaining updates post-install.
After that the first thing I tried to do was to install build-essential, which failed, because the version of libc6 was out of sync with the rest of the libc6* packages: libc6 was already at 2.31-0ubuntu9.9, while e.g. libc6-dev was still only available as 2.31-0ubuntu9.7.
I tried switching from my local archive (fi.archive.ubuntu.com) to the main one (archive.ubuntu.com), but that made no difference. I had to downgrade libc6 to 2.31-0ubuntu9.7 to be able to install build-essential.