(QE-147) Add support to deploy package repositories
Only run apt-get update when it is needed

This refactors the debian packaging to make sure apt-get updates only
happen when they're needed.