Debian Auto update / Unattended update

Here's a quick way, to enable Debian to autoupdate.
1. Install unattended upgrades and mailx.
#> apt-get install unattended-upgrades bsd-mailx
2. Configure the upgrades
#> vi /etc/apt/apt.conf.d/50unattended-upgrades

Normally the default configuration should be ok; if you want to change anything, please read the comments in the file which make the configuration self-explaining. For example, you can specify the upgrade origins (default: stable and security), you can blacklist packages that should not be updated, you can have the system email you if there are problems, you can have the system remove unused dependencies after an update, or you can make the system do an automatic reboot if this is needed after an update. Please note: The double slashes // serve as a comment; anything that follows a comment in the same line will not be evaluated.

3. Then create file /etc/apt/apt.conf.d/02periodic to enable it.


// Enable the update/upgrade script (0=disable)
APT::Periodic::Enable "1";

// Do "apt-get update" automatically every n-days (0=disable)
APT::Periodic::Update-Package-Lists "1";

// Do "apt-get upgrade --download-only" every n-days (0=disable)
APT::Periodic::Download-Upgradeable-Packages "1";

// Run the "unattended-upgrade" security upgrade script
// every n-days (0=disabled)
// Requires the package "unattended-upgrades" and will write
// a log in /var/log/unattended-upgrades
APT::Periodic::Unattended-Upgrade "1";

// Do "apt-get autoclean" every n-days (0=disable)
APT::Periodic::AutocleanInterval "7";


Unattended upgrades will run once per day from the cron /etc/cron.daily/apt
The script will log to the file /var/log/unattended-upgrades/unattended-upgrades.log

Trackbacks

Trackback specific URI for this entry

This link is not meant to be clicked. It contains the trackback URI for this entry. You can use this URI to send ping- & trackbacks from your own blog to this entry. To copy the link, right click and select "Copy Shortcut" in Internet Explorer or "Copy Link Location" in Mozilla.

No Trackbacks

Comments

Display comments as Linear | Threaded

No comments

Add Comment

You can use [geshi lang=lang_name [,ln={y|n}]][/geshi] tags to embed source code snippets.
Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.
To leave a comment you must approve it via e-mail, which will be sent to your address after submission.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA