I tried this really interesting solution today, which worked for me on an Ubuntu server. Some DNS or another issue in the apt was making it adamant to not installing some packages from a custom PPA. What I did was install the apt-fast package and use it to install my packages instead of apt.
apt-fast is an alternative to apt which works on top of apt but uses aria2c to download packages. It is used to increase the download speed. In my case, it also solved whatever network problem was making apt to fail.
Using it is exactly the same as apt:
sudo apt-fast install package-name