A good hint to protect these "remote installations/upgrade" from several network issues that may occur, is to run these procedures under 'screen'. I.e.
In this way, even if you loose the connection to your server, you can easily come back later and run:
# screen -r
There is a screen on:
There is no screen to be resumed.
Oops, the screen has remained attached (because we lost the connection). Let's detach it:
And resume it:
Now you should see your setup running again, where you left it.