[apt]: switching shell crap to python syntax

Avoid long string of piped shell commands at all cost
Fixes: #398

Signed-off-by: Louis Bouchard <louis.bouchard@canonical.com>
is this left over from debugging?