Skip to content

Instantly share code, notes, and snippets.

@jodell
Created January 15, 2010 21:50
Show Gist options
  • Save jodell/278448 to your computer and use it in GitHub Desktop.
Save jodell/278448 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Automatically apply security updates, resets to normal repo listings,
# and downloads packages ahead of time for manual upgrades.
# This is necessary if you're running Ubuntu (always unstable), have
# custom repos that you might not want to auto-update from, etc.
# Cron'ing this script helps ward off auditors and cyber-ninjas alike.
# -jodell 20100115
# Assumes that you've partitioned security repo lines appropriately
sudo apt-get -o "Dir::Etc::SourceList=/etc/apt/security.list" -o "Dir::Etc::sourceparts=''" update
sudo apt-get upgrade -y
# Reset to default sources
sudo apt-get update
# Download packages only
sudo apt-get -y -d dist-upgrade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment