{"id":5793,"date":"2026-10-30T07:08:06","date_gmt":"2026-10-29T22:08:06","guid":{"rendered":"https:\/\/matoken.org\/blog\/?p=5793"},"modified":"2026-10-30T07:08:08","modified_gmt":"2026-10-29T22:08:08","slug":"automatically-upgrade-debian-on-vps-with-unattended-upgrade","status":"publish","type":"post","link":"https:\/\/matoken.org\/blog\/2026\/10\/30\/automatically-upgrade-debian-on-vps-with-unattended-upgrade\/","title":{"rendered":"VPS\u306eDebian\u3092unattended-upgrade\u3067\u81ea\u52d5\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9"},"content":{"rendered":"<div id=\"preamble\">\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>VPS\u3092\u3044\u304f\u3064\u304b\u5951\u7d04\u3057\u3066\u3044\u307e\u3059\u3002\u30b7\u30b9\u30c6\u30e0\u306e\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u306f\u624b\u52d5\u3067\u884c\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\u3067\u3082\u6570\u65e5PC\u306b\u89e6\u308c\u306a\u3044\u3053\u3068\u306a\u3093\u304b\u3082\u3042\u308a\u6700\u8fd1\u306e\u60c5\u52e2\u304b\u3089\u3059\u308b\u3068\u4e0d\u5b89\u3002\u3068\u3044\u3046\u3053\u3068\u3067\u30b7\u30b9\u30c6\u30e0\u306e\u81ea\u52d5\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u3092\u8a2d\u5b9a\u3057\u307e\u3057\u305f\u3002<\/p>\n<\/div>\n<p><!--more--><\/p>\n<div class=\"paragraph\">\n<p>\u4eca\u56de\u306e\u5bfe\u8c61\u306fDebian trixie amd64\u74b0\u5883\u3002\u3053\u308c\u307e\u3067\u306fapticron\u3092\u52d5\u304b\u3057\u3066\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u66f4\u65b0\u3068\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u306f\u81ea\u52d5\u5316\u3057\u3066\u3044\u307e\u3057\u305f\u3002<br \/>\n\u4ee5\u524d\u306fcron-apt\u3092\u4f7f\u3063\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u4eca\u56de unattended-upgrades\u3092\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\uff0e<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_unattended_upgrades_\u3092\u5c0e\u5165\">unattended-upgrades \u3092\u5c0e\u5165<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>apt\u3067unattended-upgrades\u3092\u5c0e\u5165\u3057\u3066\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>$ sudo apt install unattended-upgrades <b class=\"conum\">(1)<\/b>\n$ sudo dpkg-reconfigure unattended-upgrades <b class=\"conum\">(2)<\/b>\nPackage configuration\n\n\n\n  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 Configuring unattended-upgrades \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n  \u2502                                                                         \u2502\n  \u2502 Applying updates on a frequent basis is an important part of keeping    \u2502\n  \u2502 systems secure. By default, updates need to be applied manually using   \u2502\n  \u2502 package management tools. Alternatively, you can choose to have this    \u2502\n  \u2502 system automatically download and install important updates.            \u2502\n  \u2502                                                                         \u2502\n  \u2502 Automatically download and install stable updates?                      \u2502\n  \u2502                                                                         \u2502\n  \u2502                    &lt;Yes&gt;                       &lt;No&gt;                     \u2502\n  \u2502                                                                         \u2502\n  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n\n\n\n\nReplacing config file \/etc\/apt\/apt.conf.d\/20auto-upgrades with new version\n$ cat  \/etc\/apt\/apt.conf.d\/20auto-upgrades\nAPT::Periodic::Update-Package-Lists \"1\";\nAPT::Periodic::Unattended-Upgrade \"1\";<\/pre>\n<\/div>\n<\/div>\n<div class=\"colist arabic\">\n<ol>\n<li>\n<p>unattended-upgrades\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u5c0e\u5165<\/p>\n<\/li>\n<li>\n<p>dpkg-reconfigure \u3067 <code>&lt;Yes&gt;<\/code> \u3092\u9078\u629e<\/p>\n<\/li>\n<\/ol>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/matoken.org\/blog\/wp-content\/uploads\/2026\/10\/unattended-upgrades.webp\" alt=\"unattended upgrades\"><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>\u30e1\u30fc\u30eb\u901a\u77e5\u3092\u6709\u52b9\u306b\u3059\u308b<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>$ sudo vi \/etc\/apt\/apt.conf.d\/50unattended-upgrades\n$ sudo git -C \/etc diff \/etc\/apt\/apt.conf.d\/50unattended-upgrades\ndiff --git a\/apt\/apt.conf.d\/50unattended-upgrades b\/apt\/apt.conf.d\/50unattended-upgrades\nindex 26f84e133..007af9182 100644\n--- a\/apt\/apt.conf.d\/50unattended-upgrades\n+++ b\/apt\/apt.conf.d\/50unattended-upgrades\n@@ -92,13 +92,13 @@ Unattended-Upgrade::Package-Blacklist {\n \/\/ If empty or unset then no email is sent, make sure that you\n \/\/ have a working mail setup on your system. A package that provides\n \/\/ 'mailx' must be installed. E.g. \"user@example.com\"\n-\/\/Unattended-Upgrade::Mail \"\";\n+Unattended-Upgrade::Mail \"user@example.com\"; <b class=\"conum\">(1)<\/b>\n\n \/\/ Set this value to one of:\n \/\/    \"always\", \"only-on-error\" or \"on-change\"\n \/\/ If this is not set, then any legacy MailOnlyOnError (boolean) value\n \/\/ is used to chose between \"only-on-error\" and \"on-change\"\n-\/\/Unattended-Upgrade::MailReport \"on-change\";\n+Unattended-Upgrade::MailReport \"always\"; <b class=\"conum\">(2)<\/b>\n\n \/\/ Remove unused automatically installed kernel-related packages\n \/\/ (kernel images, kernel headers and kernel version locked tools).\n$ sudo unattended-upgrade --dry-run --debug <b class=\"conum\">(3)<\/b>\n$ sudo unattended-upgrade --debug<\/pre>\n<\/div>\n<\/div>\n<div class=\"colist arabic\">\n<ol>\n<li>\n<p>\u901a\u77e5\u3092\u9001\u308b\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9<\/p>\n<\/li>\n<li>\n<p>\u5b9f\u884c\u821e\u306b\u901a\u77e5\u3002\u3057\u3070\u3089\u304f\u52d5\u304b\u3057\u305f\u3089 <code>on-change<\/code> \u306b\u5909\u66f4\u4e88\u5b9a<\/p>\n<\/li>\n<li>\n<p>\u52d5\u4f5c\u78ba\u8a8d<\/p>\n<\/li>\n<\/ol>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\">apticron\u306f\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/div>\n<div class=\"content\">\n<pre>$ sudo apt remove apticron<\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>\u3057\u3070\u3089\u304f\u52d5\u304b\u3057\u3066\u898b\u3066\u554f\u984c\u306a\u3051\u308c\u3070\u5225\u306eVPS\u306b\u3082\u53cd\u6620\u3057\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_\u74b0\u5883\">\u74b0\u5883<\/h2>\n<div class=\"sectionbody\">\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>$ dpkg-query -W unattended-upgrades\nunattended-upgrades     2.12\n$ lsb_release -dr\nDescription:    Debian GNU\/Linux 13 (trixie)\nRelease:        13\n$ arch\nx86_64<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_toot\">toot<\/h2>\n<div class=\"sectionbody\">\n<div class=\"ulist\">\n<ul>\n<li>\n<p><a href=\"https:\/\/snac.matoken.org\/matoken\/p\/1793308169.323822\">vps\u306eupgrade\u4eca\u306f\u624b\u52d5\u3067\u3084\u3063\u3066\u308b\u3051\u3069\u81ea\u52d5\u5316\u3057\u3088\u3046\u304b\u306a\u2026\u2026<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>VPS\u3092\u3044\u304f\u3064\u304b\u5951\u7d04\u3057\u3066\u3044\u307e\u3059\u3002\u30b7\u30b9\u30c6\u30e0\u306e\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u306f\u624b\u52d5\u3067\u884c\u3063\u3066\u3044\u307e\u3059\u3002 \u3067\u3082\u6570\u65e5PC\u306b\u89e6\u308c\u306a\u3044\u3053\u3068\u306a\u3093\u304b\u3082\u3042\u308a\u6700\u8fd1\u306e\u60c5\u52e2\u304b\u3089\u3059\u308b\u3068\u4e0d\u5b89\u3002\u3068\u3044\u3046\u3053\u3068\u3067\u30b7\u30b9\u30c6\u30e0\u306e\u81ea\u52d5\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u3092\u8a2d\u5b9a\u3057\u307e\u3057\u305f\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"webmentions_disabled_pings":false,"webmentions_disabled":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"federated","footnotes":""},"categories":[7,6,1231],"tags":[1303],"class_list":["post-5793","post","type-post","status-publish","format-standard","hentry","category-debian-linux","category-linux","category-trixie","tag-unattended-upgrade"],"_links":{"self":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/5793","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/comments?post=5793"}],"version-history":[{"count":1,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/5793\/revisions"}],"predecessor-version":[{"id":5794,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/5793\/revisions\/5794"}],"wp:attachment":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/media?parent=5793"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/categories?post=5793"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/tags?post=5793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}