Reduce duplicated code
Fail with meaningful error message if python-apt isn't installed

This catches the CommandExecutionError raised when python-apt isn't
available and displays the error message as the comment in the return
data for the state.