I tried to update the apt cache on a machine that had not been updated in a long time:
But that got stuck at one of the repositories Waiting for headers. No matter how many times I tried the command, it would get stuck at this.
The problem went away once I cleared the cache using these steps as explained here:
Tried with: Ubuntu 18.04.3 LTS