49
41

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Ubuntuでsecurity updateのみ自動的に適用する

Last updated at Posted at 2015-02-04

あるのかな〜と思って探したらオフィシャルドキュメントにあった。

自動更新にはunattended-upgradesパッケージが必要。コマンドラインから実行するには
dpkg-reconfigure -plow unattended-upgradesし、パッケージ設定のビューになるので Yes を選択する。

kobito.1423050318.052715.png

設定ファイルとして/etc/apt/apt.conf.d/20auto-upgradesが生成される。

/etc/apt/apt.conf.d/20auto-upgrades
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";

実際にどういったパッケージを更新するかは/etc/apt/apt.conf.d/50unattended-upgradesファイルにまとめられている。デフォルトではセキュリティアップデートのみ有効。

/etc/apt/apt.conf.d/50unattended-upgrades
// Automatically upgrade packages from these (origin:archive) pairs
Unattended-Upgrade::Allowed-Origins {
        "${distro_id}:${distro_codename}-security";
//      "${distro_id}:${distro_codename}-updates";
//      "${distro_id}:${distro_codename}-proposed";
//      "${distro_id}:${distro_codename}-backports";
};

更新ログは/var/log/aptitudeを確認しましょう。

Aptitude 0.6.8.2: log report
Wed, Feb  4 2015 11:37:09 +0000

IMPORTANT: this log only lists intended actions; actions which fail due to
dpkg problems may not be completed.

Will install 0 packages, and remove 0 packages.
===============================================================================
[HOLD, DEPENDENCIES] linux-headers-generic:amd64
[HOLD, DEPENDENCIES] linux-headers-virtual:amd64
[HOLD, DEPENDENCIES] tzdata-java:amd64
[HOLD] libelf1:amd64
[HOLD] linux-image-virtual:amd64
[HOLD] linux-virtual:amd64
[HOLD] python3-software-properties:amd64
[HOLD] rsyslog:amd64
[HOLD] software-properties-common:amd64
[HOLD] tzdata:amd64
===============================================================================

Log complete.
49
41
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
49
41

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?