Skip to content

Instantly share code, notes, and snippets.

@bitdivine
Created October 20, 2014 12:00
Show Gist options
  • Save bitdivine/f040ba2f1507dac58455 to your computer and use it in GitHub Desktop.
Save bitdivine/f040ba2f1507dac58455 to your computer and use it in GitHub Desktop.
apt-get update is SLOW (>1sec) so do it only if it hasn't been done in the last 10 hours.
(( ( $(date +%s) - $(date -d"$(stat -c %y /var/lib/apt/lists)" +%s) ) < 36000 )) || apt-get update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment