[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>
[apt] Removing leftover debugging code

Signed-off-by: Louis Bouchard <louis.bouchard@canonical.com>
Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>