ubuntu server に自動アップデート設定


ubuntu server にセキュリティパッチなどを自動アップデートするように設定する. unattended-upgrades パッケージを入れればOK.

apt-get update
apt-get install unattended-upgrades

設定ファイルは /etc/apt/apt.conf.d/50unattended-upgrades にある.


Unattended-Upgrade::Allowed-Origins {
        "${distro_id} ${distro_codename}-security";
//      "${distro_id} ${distro_codename}-updates";
//      "${distro_id} ${distro_codename}-proposed";
//      "${distro_id} ${distro_codename}-backports";


Unattended-Upgrade::Package-Blacklist {
//      "vim";
//      "libc6";
//      "libc6-dev";
//      "libc6-i686";

アップデートログをメールで送る設定. 成功/失敗共に送ったり,失敗したときのみ送ったりできる.

// Send email to this address for problems or packages upgrades
// If empty or unset then no email is sent, make sure that you
// have a working mail setup on your system. The package 'mailx'
// must be installed or anything that provides /usr/bin/mail.
Unattended-Upgrade::Mail "root@localhost";

// Set this value to "true" to get emails only on errors. Default
// is to always send a mail if Unattended-Upgrade::Mail is set
//Unattended-Upgrade::MailOnlyOnError "true";

1 comment — post a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

CAPTCHA * Time limit is exhausted. Please reload CAPTCHA.