Single shot to download packages

you could try to change your option 
apt-get -y install singlepackage to
apt-get -y install multiple package 
this change minimize the connections to the repository,also reduce the time of execution.

If you have a text file containing a list of software packages to install, you can bulk install all the packages in one shot as follows.

apt-get install -y `cat package.txt | tr "\n" " "`