After a frustrating evening trying to setup a Ubuntu 20.04 VM and being unable to upgrade any packages I had to dig into the detail of what the issue was.
TL;DR The issue turned out to be a conflict with Windows Subsystem for Linux (WSL) that uses Hyper-V behind the scenes. The solution being to either remove Windows virtualisation platform or configure VM’s to user Hyper-V in Virtualbox.
The issue being that running apt update failed with hashsum mismatches. I initially thought it may be an apt configuration issue and tried various update servers and switched the archive format to gzip to no avail.
I am aware of the issues with Hyper-V and Virtualbox which I didn’t have installed, or so I thought. Since Windows 1904 the WSL has used Hyper-V behind the scenes.
Virtualbox added a workaround for this in December 2018:
“Added support for using Hyper-V as the fallback execution core on Windows host, to avoid inability to run VMs at the price of reduced performance”
It is also now covered in the WSL FAQ that this conflict exists.
Hopefully this short post will help others that hit this issue.