I have no good explanation for why this might work, but it just did for me, when I got these errors trying to do
sudo apt install emacs25 or
sudo apt-get install emacs25. So in case it works for others:
This install of
emacs25/bionic,now 25.2+1-6 amd64 required several dependent packages, namely:
emacs25-bin-common/bionic,now 25.2+1-6 amd64
emacs25-common/bionic,bionic,now 25.2+1-6 all
emacs25-el/bionic,bionic,now 25.2+1-6 all
emacsen-common/bionic,bionic,now 2.0.8 all
I wanted to see if I could narrow down what the particular problem file was, since they were all throwing hash sum errors, so I tried to install
emacs25-common. Same issue (though it had dependencies on all the other three numbered above).
Then I tried
sudo apt install emacs25-el. This worked, and curiously, the first dependency it installed was
emacs25-common — the one I'd just tried to install unsuccessfully. It installed
emacs25-common and the other three packages (all except for
emacs25 itself) successfully.
Then I did
sudo apt install emacs25. This, too, worked.
So this is voodoo, but I would suggest trying to install the dependencies separately first, trying different dependencies, until one does install, and then trying again.
My guess would be that something server-side was being cached, and breaking the normal order of requests resulted in a cache miss allowing the original file to be re-checksummed, but that's a total stab in the dark.
(After the above was done I was able to install the suggested package using
sudo apt install emacs25-common-non-dfsg without issues.)