A relatively simple way to do it is by installing a program called caffeine. You'll need to add the repository then install it. For example, via the terminal.
sudo add-apt-repository ppa:caffeine-developers/ppa && sudo apt-get update && sudo apt-get install caffeine && sudo apt-get install gir1.2-appindicator3-0.1 gir1.2-notify-0.7
(N.B. you'll need gir1.2-appindicator3-0.1 and gir1.2-notify-0.7 at the moment due to a bug in defining its dependencies.)
Once you have it installed and running, it should create an entry in the menubar or panel. You can manually prevent suspension, or set caffeine to activate automatically based on what processes are running. In your case, you can whitelist the installation program, such as apt-get
. (I'm not sure what that is specifically, since you didn't provide the details.)
N.B. I'm using Kubuntu, where it works well. It should also work in Unity.
Update
New versions of caffeine have been crippled, and much of this functionality has been removed.. I think the old version (2.5) still works, though, so you can try that.