{"id":1809,"date":"2020-05-01T12:06:51","date_gmt":"2020-05-01T19:06:51","guid":{"rendered":"https:\/\/jim-zimmerman.com\/?p=1809"},"modified":"2020-05-02T17:57:29","modified_gmt":"2020-05-03T00:57:29","slug":"ubuntu-disable-automatic-updates","status":"publish","type":"post","link":"https:\/\/jim-zimmerman.com\/?p=1809","title":{"rendered":"Ubuntu: Disable Automatic Updates"},"content":{"rendered":"<p>UPDATE: What outlined below did not work, so here is what I ended up doing:<\/p>\n<p>Change directory to:<\/p>\n<blockquote><p>$ cd \/etc\/apt\/apt.conf.d<\/p><\/blockquote>\n<p>Edit the 20auto-upgrades, and change the Lists setting from 1 to 0:<\/p>\n<blockquote><p>$ sudo vi 20auto-upgrades<br \/>\nAPT::Periodic::Update-Package-Lists &#8220;0&#8221;;<br \/>\nAPT::Periodic::Unattended-Upgrade &#8220;1&#8221;;<\/p><\/blockquote>\n<p>Now, with the list disabled the service should never find anything to update.<\/p>\n<p>Another option is just get rid of the service:<\/p>\n<blockquote><p>$ sudo apt remove unattended-upgrades<\/p><\/blockquote>\n<p>Note: The following did not work in Ubuntu 18.x:<\/p>\n<p>For reason, I don&#8217;t know if this an Azure deployment issue or an Ubuntu decision, but I have found automatic updates turned on by default in a couple VMs.  Not sure why you would ever want your production server automatically updating, so:<\/p>\n<p>Check to status of the unattended-upgrades service:<\/p>\n<blockquote><p>$ sudo systemctl status unattended-upgrades<\/p><\/blockquote>\n<p>Stop the service:<\/p>\n<blockquote><p>$ sudo systemctl stop  unattended-upgrades<\/p><\/blockquote>\n<p>Disable the service.  NOTE: Services that have this as a dependency will start the service despite it being disabled.  I am not aware of any for this service, but just putting it out there.<\/p>\n<blockquote><p>$ sudo systemctl disable  unattended-upgrades<\/p><\/blockquote>\n<p>To prevent the unintended situation above, mask will create a link to \/dev\/null to prevent the service from being started whether there are dependencies or not.<\/p>\n<blockquote><p>$ sudo systemctl mask  unattended-upgrades<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>UPDATE: What outlined below did not work, so here is what I ended up doing: Change directory to: $ cd \/etc\/apt\/apt.conf.d Edit the 20auto-upgrades, and change the Lists setting from 1 to 0: $ sudo vi 20auto-upgrades APT::Periodic::Update-Package-Lists &#8220;0&#8221;; APT::Periodic::Unattended-Upgrade &#8220;1&#8221;; Now, with the list disabled the service should never find anything to update. Another [&#038;hellip<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[496,132,123],"class_list":["post-1809","post","type-post","status-publish","format-standard","hentry","category-documentation","tag-systemctl","tag-ubuntu","tag-upgrade"],"share_on_mastodon":{"url":"","error":""},"_links":{"self":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/1809","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1809"}],"version-history":[{"count":3,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/1809\/revisions"}],"predecessor-version":[{"id":1812,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/1809\/revisions\/1812"}],"wp:attachment":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1809"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1809"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1809"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}