logo sykohpath.com

				where code goes to die
			
	
tagstagstagstagstags

Auto-install Important Updates

I'm one of those people that like to have everything updated every day.  So, every day when I log-in, I run Update Manager.  Well, that's freaking annoying, why can't it run automatically?  CRON JOB TIME.

First, get this through Software Manager, or whatever you use.  The package is called:
unattended-upgrades

Next, open terminal...well, open this biglong filename:
Code Sample:
  1. sudo gedit /etc/apt/apt.conf.d/02periodic


And cram all this stuff inside:
Code Sample:
  1. # Enable the update script (0 = disable)
  2. APT::Periodic::Enable "1";
  3. # Get package lists every X days - apt-get update
  4. APT::Periodic::Update-Package-Lists "1";
  5. # Get upgrades every X days - apt-get upgrade --download-only
  6. APT::Periodic::Download-Upgradeable-Packages "0";
  7. # Clean every X days - apt-get autoclean
  8. APT::Periodic::AutocleanInterval "0";
  9. # Allow unattended script to run
  10. # Requires the package “unattended-upgrades” and will write
  11. # a log in /var/log/unattended-upgrades
  12. APT::Periodic::Unattended-Upgrade "1";


Change how often you want to update...heck, just read the comments, it's pretty self-explanatory.

Next, confirm the settings for what you actually want to download.  
Code Sample:
  1. sudo gedit /etc/apt/apt.conf.d/50unattended-upgrades


My default didn't grab "stable", so I had to add it at the top:
Code Sample:
  1. // Automatically upgrade packages from these (origin, archive) pairs
  2. Unattended-Upgrade::Allowed-Origins {
  3. "${distro_id} stable";
  4. "${distro_id} ${distro_codename}-security";
  5. // "${distro_id} ${distro_codename}-updates";
  6. // "${distro_id} ${distro_codename}-proposed";
  7. // "${distro_id} ${distro_codename}-backports";
  8. };
  9. // List of packages to not update
  10. Unattended-Upgrade::Package-Blacklist {
  11. // "vim";
  12. // "libc6";
  13. // "libc6-dev";
  14. // "libc6-i686";
  15. };
  16. // This option allows you to control if on a unclean dpkg exit
  17. // unattended-upgrades will automatically run
  18. //   dpkg --force-confold --configure -a
  19. // The default is true, to ensure updates keep getting installed
  20. //Unattended-Upgrade::AutoFixInterruptedDpkg "false";
  21. // Split the upgrade into the smallest possible chunks so that
  22. // they can be interrupted with SIGUSR1. This makes the upgrade
  23. // a bit slower but it has the benefit that shutdown while a upgrade
  24. // is running is possible (with a small delay)
  25. //Unattended-Upgrades::MinimalSteps "true";
  26. // Send email to this address for problems or packages upgrades
  27. // If empty or unset then no email is sent, make sure that you
  28. // have a working mail setup on your system. The package 'mailx'
  29. // must be installed or anything that provides /usr/bin/mail.
  30. //Unattended-Upgrade::Mail "root@localhost";
  31. // Set this value to "true" to get emails only on errors. Default
  32. // is to always send a mail if Unattended-Upgrade::Mail is set
  33. //Unattended-Upgrade::MailOnlyOnError "true";
  34. // Do automatic removal of new unused dependencies after the upgrade
  35. // (equivalent to apt-get autoremove)
  36. //Unattended-Upgrade::Remove-Unused-Dependencies "false";
  37. // Automatically reboot *WITHOUT CONFIRMATION* if a
  38. // the file /var/run/reboot-required is found after the upgrade
  39. //Unattended-Upgrade::Automatic-Reboot "false";
  40. // Use apt bandwidth limit feature, this example limits the download
  41. // speed to 70kb/sec
  42. //Acquire::http::Dl-Limit "70";


Aaaaand you're all set.  So now I can simply log in and magically...not manually update every dang thing.

ubuntu, mint 12, linux, auto install, updates,


0 comments.