Craft 3 Ubuntu installation error via composer setup
[SOLVED] By upping wait_timeout from 10 to 100 in my.cnf - seems to have fixed the issue. 

Initial google searches for "Error while sending QUERY packet" led me to increase max_allowed_packet size, but this didn't fix the problem alone. 
Note, I'm not sure if both timeout and packet size need to be increased or just timeout nevertheless I have increased both and it works now.

Another side note on my server setup, the server I had problem with was a default Vesta CP ubuntu/mysql configuration. I had no problem installing Craft 3 on a different ubuntu 16 configured by Serverpilot.io.