{"id":29,"date":"2024-12-06T12:06:15","date_gmt":"2024-12-06T12:06:15","guid":{"rendered":"https:\/\/www.glencoulson.com\/?p=29"},"modified":"2024-12-06T12:06:15","modified_gmt":"2024-12-06T12:06:15","slug":"ubuntu-unattended-updates","status":"publish","type":"post","link":"https:\/\/www.glencoulson.com\/index.php\/2024\/12\/06\/ubuntu-unattended-updates\/","title":{"rendered":"Ubuntu unattended updates"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This file below allows you to specify which packages should automatically be updated or excluded during the update process. By default, only security updates are set to be automatically installed.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vim \/etc\/apt\/apt.conf.d\/50unattended-upgrades<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To exclude a package from being updated, include it in the&nbsp;<strong>Unattended-Upgrade::Package-Blacklist<\/strong>&nbsp;section. For example, to prevent Nginx from being updated, include the name as shown below:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The configurations in the file are commented using the double slash (\/\/). Uncomment or remove the double slash if you want to update a repository or make changes in your settining<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/web.archive.org\/web\/20221201055030im_\/https:\/\/i0.wp.com\/www.glencoulson.com\/wp-content\/uploads\/2022\/07\/image-1.png?resize=868%2C204&amp;ssl=1\" alt=\"\" class=\"wp-image-144\"\/><figcaption class=\"wp-element-caption\">Eliminating a package from updates.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">It\u2019s a wise to set up e-mail notifications, especially if you\u2019re running unattended servers. You can also select \u201conly-on-error\u201d to receive notifications only when there&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Unattended-Upgrade::Mail<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Provide email of the recipient.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>Unattended-Upgrade::Mail \"me@example.com \";<\/strong><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Set it to true to enable automatic reboot.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"830\" height=\"83\" src=\"https:\/\/www.glencoulson.com\/wp-content\/uploads\/2024\/12\/word-image-445.png\" alt=\"\" class=\"wp-image-31\" srcset=\"https:\/\/www.glencoulson.com\/wp-content\/uploads\/2024\/12\/word-image-445.png 830w, https:\/\/www.glencoulson.com\/wp-content\/uploads\/2024\/12\/word-image-445-300x30.png 300w, https:\/\/www.glencoulson.com\/wp-content\/uploads\/2024\/12\/word-image-445-768x77.png 768w\" sizes=\"auto, (max-width: 830px) 100vw, 830px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If there are any users logged in and you still want to reboot locate the following line and set it to true<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Unattended-Upgrade::Automatic-Reboot-WithUsers<\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"767\" height=\"94\" src=\"https:\/\/www.glencoulson.com\/wp-content\/uploads\/2024\/12\/word-image-447.png\" alt=\"\" class=\"wp-image-32\" srcset=\"https:\/\/www.glencoulson.com\/wp-content\/uploads\/2024\/12\/word-image-447.png 767w, https:\/\/www.glencoulson.com\/wp-content\/uploads\/2024\/12\/word-image-447-300x37.png 300w\" sizes=\"auto, (max-width: 767px) 100vw, 767px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">There are many other settings you can change to suit your needs. Simply uncomment them as we have discussed in this section.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once you are done, save the changes and exit the configuration file<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This file below allows you to specify which packages should automatically be updated or excluded during the update process. By default, only security updates are set to be automatically installed. To exclude a package from being updated, include it in the&nbsp;Unattended-Upgrade::Package-Blacklist&nbsp;section. For example, to prevent Nginx from being updated, include the name as shown below: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[5],"class_list":["post-29","post","type-post","status-publish","format-standard","hentry","category-coding","tag-computers"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":8}},"_links":{"self":[{"href":"https:\/\/www.glencoulson.com\/index.php\/wp-json\/wp\/v2\/posts\/29","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.glencoulson.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.glencoulson.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.glencoulson.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.glencoulson.com\/index.php\/wp-json\/wp\/v2\/comments?post=29"}],"version-history":[{"count":2,"href":"https:\/\/www.glencoulson.com\/index.php\/wp-json\/wp\/v2\/posts\/29\/revisions"}],"predecessor-version":[{"id":33,"href":"https:\/\/www.glencoulson.com\/index.php\/wp-json\/wp\/v2\/posts\/29\/revisions\/33"}],"wp:attachment":[{"href":"https:\/\/www.glencoulson.com\/index.php\/wp-json\/wp\/v2\/media?parent=29"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glencoulson.com\/index.php\/wp-json\/wp\/v2\/categories?post=29"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glencoulson.com\/index.php\/wp-json\/wp\/v2\/tags?post=29"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}