{"id":13883,"date":"2019-04-06T13:26:56","date_gmt":"2019-04-06T13:26:56","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=13883"},"modified":"2019-04-06T13:26:56","modified_gmt":"2019-04-06T13:26:56","slug":"how-to-install-security-updates-automatically-on-debian-and-ubuntu","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/06\/how-to-install-security-updates-automatically-on-debian-and-ubuntu\/","title":{"rendered":"How to Install Security Updates Automatically on Debian and Ubuntu"},"content":{"rendered":"<p>It has been said before -and I couldn\u2019t agree more- that some of the best system administrators are those who seem (note the use of the word seem here) to be lazy all the time.<\/p>\n<p>While that may sound somewhat paradoxical, I bet it must be true in most cases \u2013 not because they are not doing the job they are supposed to be doing, but rather because they have automated most of it.<\/p>\n<p>One of the critical needs of a Linux system is to be kept up to date with the latest security patches available for the corresponding distribution.<\/p>\n<p>In this article we will explain how to set up your\u00a0<strong>Debian<\/strong>\u00a0and\u00a0<strong>Ubuntu<\/strong>\u00a0system to auto install (or update) essential security packages or patches automatically when needed.<\/p>\n<p>Other Linux distributions such as\u00a0<a href=\"https:\/\/www.tecmint.com\/auto-install-security-patches-updates-on-centos-rhel\/\" target=\"_blank\" rel=\"noopener\">CentOS\/RHEL configured to install security updates automatically<\/a>.<\/p>\n<p>Needless to say, you will need superuser privileges in order to perform the tasks outlined in this article.<\/p>\n<h3>Configure Automatic Security Updates On Debian\/Ubuntu<\/h3>\n<p>To begin, install the following packages:<\/p>\n<pre># aptitude update -y &amp;&amp; aptitude install unattended-upgrades apt-listchanges -y\r\n<\/pre>\n<p>where\u00a0<strong>apt-listchanges<\/strong>\u00a0will report what has been changed during an upgrade.<\/p>\n<p>Next, open\u00a0<strong>\/etc\/apt\/apt.conf.d\/50unattended-upgrades<\/strong>\u00a0with your preferred text editor and add this line inside the\u00a0<strong>Unattended-Upgrade::Origins-Pattern<\/strong>\u00a0block:<\/p>\n<pre>Unattended-Upgrade::Mail \"root\";\r\n<\/pre>\n<p>Finally, use the following command to create and populated the required configuration file (<strong>\/etc\/apt\/apt.conf.d\/20auto-upgrades<\/strong>) to activate the unattended updates:<\/p>\n<pre># dpkg-reconfigure -plow unattended-upgrades\r\n<\/pre>\n<p>Choose\u00a0<code>Yes<\/code>\u00a0when prompted to install unattended upgrades:<\/p>\n<div id=\"attachment_23380\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Configure-Unattended-Security-Updates-on-Debian.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23380\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Configure-Unattended-Security-Updates-on-Debian.png\" sizes=\"auto, (max-width: 823px) 100vw, 823px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Configure-Unattended-Security-Updates-on-Debian.png 823w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Configure-Unattended-Security-Updates-on-Debian-768x205.png 768w\" alt=\"Configure Unattended Security Updates on Debian\" width=\"823\" height=\"220\" aria-describedby=\"caption-attachment-23380\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23380\" class=\"wp-caption-text\">Configure Unattended Security Updates on Debian<\/p>\n<\/div>\n<p>then check that the following two lines have been added to\u00a0<strong>\/etc\/apt\/apt.conf.d\/20auto-upgrades<\/strong>:<\/p>\n<pre>APT::Periodic::Update-Package-Lists \"1\";\r\nAPT::Periodic::Unattended-Upgrade \"1\";\r\n<\/pre>\n<p>And add this line to make reports verbose:<\/p>\n<pre>APT::Periodic::Verbose \"2\";\r\n<\/pre>\n<p>Last, inspect\u00a0<strong>\/etc\/apt\/listchanges.conf<\/strong>\u00a0to make sure notifications will be sent to\u00a0<strong>root<\/strong>.<\/p>\n<div id=\"attachment_23381\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Notify-Security-Updates-on-Debian.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23381\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/11\/Notify-Security-Updates-on-Debian.png\" alt=\"Notify Security Updates on Debian\" width=\"312\" height=\"115\" aria-describedby=\"caption-attachment-23381\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-23381\" class=\"wp-caption-text\">Notify Security Updates on Debian<\/p>\n<\/div>\n<p>In this post we have explained how to make sure your system is updated regularly with the latest security patches. Additionally, you learned how to set up notifications in order to keep yourself informed when patches are applied.<\/p>\n<p>Do you have any questions about this article? Feel free to drop us a note using the comment form below. We look forward to hearing from you.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/auto-install-security-updates-on-debian-and-ubuntu\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It has been said before -and I couldn\u2019t agree more- that some of the best system administrators are those who seem (note the use of the word seem here) to be lazy all the time. While that may sound somewhat paradoxical, I bet it must be true in most cases \u2013 not because they are &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/06\/how-to-install-security-updates-automatically-on-debian-and-ubuntu\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Install Security Updates Automatically on Debian and Ubuntu&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-13883","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13883","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=13883"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13883\/revisions"}],"predecessor-version":[{"id":13884,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13883\/revisions\/13884"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=13883"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=13883"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=13883"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}