enabled apt caching and fixed errors in scripts