Various fixes

- First update apt-get before installing anything
- Add DEBIAN_FRONTEND=noninteractive to ensure no popups are displayed during apt-get's
- Add -E to include environments in sudo commands