Configuring Apt to update automatically

April 2010


  1. Install cron-apt

  2. Prevent autoclean

    From /etc/cron-apt/action.d/3-download, remove the line that starts with autoclean. We do want to update the machine soon after updates are available, but we do not want to lose old versions of programs, as these old versions enable us to do a rollback.

  3. Add dist-upgrade

    Create a file /etc/cron-apt/action.d/4-dist-upgrade that reads:

      dist-upgrade -y
    	  

  4. Upgrade as often as you like

    Update /etc/cron.d/cron-apt to reflect the frequency of updating you wish.

    #
    # Regular cron jobs for the cron-apt package
    #
    # Every night at 4 o'clock.
    # 0 4   * * *   root    test -x /usr/sbin/cron-apt && /usr/sbin/cron-apt
    # Every hour.
    0 *     * * *   root    test -x /usr/sbin/cron-apt && /usr/sbin/cron-apt /etc/cron-apt/config2
    # Every five minutes.
    # */5 * * * *   root    test -x /usr/sbin/cron-apt && /usr/sbin/cron-apt /etc/cron-apt/config2