{"id":2317,"date":"2024-09-12T13:00:58","date_gmt":"2024-09-12T13:00:58","guid":{"rendered":"http:\/\/suimy.me\/?p=2317"},"modified":"2024-09-18T17:15:32","modified_gmt":"2024-09-18T17:15:32","slug":"how-to-disable-unattended-upgrades-in-ubuntu","status":"publish","type":"post","link":"http:\/\/suimy.me\/index.php\/2024\/09\/12\/how-to-disable-unattended-upgrades-in-ubuntu\/","title":{"rendered":"How to Disable \u201cUnattended Upgrades\u201d in Ubuntu"},"content":{"rendered":"

The Unattended Upgrades<\/strong> feature in Ubuntu allows it to automatically install important updates, like security patches and system fixes, without needing you to do it manually. <\/p>\n

This keeps your system up to date and helps protect it from security risks. It\u2019s also convenient since you don\u2019t have to remember to check for updates all the time.<\/p>\n

Now, let\u2019s check if it\u2019s installed and running.<\/p>\n

Check if \u201cUnattended Upgrades\u201d is Enabled<\/h4>\n

There are several ways to check if unattended upgrades are enabled on your Ubuntu system.<\/p>\n

One method is to look at the \/etc\/apt\/apt.conf.d\/20auto-upgrades<\/code> file. If the following options are set to \u201c1\u201d<\/strong>, it means they are enabled:<\/p>\n

\r\nAPT::Periodic::Update-Package-Lists \"1\";\r\nAPT::Periodic::Unattended-Upgrade \"1\";\r\n<\/pre>\n

This setup ensures that your package lists are updated regularly and any available updates are installed automatically.<\/p>\n

You can also review the \/etc\/apt\/apt.conf.d\/50unattended-upgrades<\/code> file for additional settings. This file defines which packages will be automatically upgraded, which will be excluded, and how often the upgrades happen. <\/p>\n

By default, security-related updates are enabled, as shown below:<\/p>\n

\r\nUnattended-Upgrade::Allowed-Origins {\r\n    \"${distro_id}:${distro_codename}\";\r\n    \"${distro_id}:${distro_codename}-security\";\r\n    \"${distro_id}ESMApps:${distro_codename}-apps-security\";\r\n    \"${distro_id}ESM:${distro_codename}-infra-security\";\r\n\/\/  \"${distro_id}:${distro_codename}-updates\";\r\n\/\/  \"${distro_id}:${distro_codename}-proposed\";\r\n\/\/  \"${distro_id}:${distro_codename}-backports\";\r\n};\r\n<\/pre>\n

Finally, to confirm that the unattended upgrades service is running, use the following command:<\/p>\n

\r\nsudo systemctl status unattended-upgrades\r\n<\/pre>\n

This will show the status of the service that handles regular updates on your machine.<\/p>\n

\"Checking\"Checking<\/span><\/span><\/figure>\n

Should you disable Unattended Upgrades?<\/h4>\n

In general, it\u2019s a good idea to keep \u201cUnattended Upgrades\u201d<\/strong> enabled, as it helps keep your system secure by automatically installing important updates. <\/p>\n

However, it can be a double-edged sword. While it ensures your system stays up to date, it might also change your system\u2019s state or introduce new issues without you knowing. In environments where stability is crucial, like production systems, you might prefer to handle updates manually.<\/p>\n

If you\u2019ve found that \u201cUnattended Upgrades\u201d<\/strong> has caused more problems than it solves, such as services failing to run after an upgrade or instability with new updates, you may want to disable it and manage updates manually. To do this, run the following command:<\/p>\n

\r\nsudo dpkg-reconfigure unattended-upgrades\r\n<\/pre>\n

You\u2019ll be prompted with the option to enable or disable \u201cUnattended Upgrades.\u201d Select No<\/strong> to disable it.<\/p>\n

\"dpkg\"dpkg<\/span><\/span><\/figure>\n

This will update the \/etc\/apt\/apt.conf.d\/20auto-upgrades<\/code> file. When you see the file, it should now set each of the configs there to \u201c0\u201d<\/strong>. This means that package lists won\u2019t be updated and any new updates won\u2019t be installed automatically.<\/p>\n

\r\nAPT::Periodic::Update-Package-Lists \"0\";\r\nAPT::Periodic::Unattended-Upgrade \"0\";\r\n<\/pre>\n

Since we\u2019ve disabled the automatic updates, we can take it further by disabling the service so it won\u2019t keep running on the machine:<\/p>\n

\r\nsudo systemctl stop unattended-upgrades\r\nsudo systemctl disable unattended-upgrades\r\n<\/pre>\n

This will force the unattended-upgrades service to remain disabled after a restart.<\/p>\n

Conclusion<\/h4>\n

While \u201cUnattended Upgrades\u201d<\/strong> is a helpful feature in Ubuntu, it may not be the best fit for every environment. If it\u2019s causing more issues, you can always disable it and take control of updates manually. This way, you can avoid unexpected changes and maintain more stability.<\/p>\n

However, once it\u2019s disabled, you\u2019ll need to regularly check for updates and install them yourself to keep your system secure. Staying up to date is important for security, so make sure you have a plan in place to manage updates efficiently.<\/p>\n

The post How to Disable \u201cUnattended Upgrades\u201d in Ubuntu<\/a> appeared first on Hongkiat<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"

The Unattended Upgrades feature in Ubuntu allows it to automatically install important updates, like security patches and system fixes, without […]<\/p>\n","protected":false},"author":1,"featured_media":2319,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[15],"tags":[],"_links":{"self":[{"href":"http:\/\/suimy.me\/index.php\/wp-json\/wp\/v2\/posts\/2317"}],"collection":[{"href":"http:\/\/suimy.me\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/suimy.me\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/suimy.me\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/suimy.me\/index.php\/wp-json\/wp\/v2\/comments?post=2317"}],"version-history":[{"count":3,"href":"http:\/\/suimy.me\/index.php\/wp-json\/wp\/v2\/posts\/2317\/revisions"}],"predecessor-version":[{"id":2322,"href":"http:\/\/suimy.me\/index.php\/wp-json\/wp\/v2\/posts\/2317\/revisions\/2322"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/suimy.me\/index.php\/wp-json\/wp\/v2\/media\/2319"}],"wp:attachment":[{"href":"http:\/\/suimy.me\/index.php\/wp-json\/wp\/v2\/media?parent=2317"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/suimy.me\/index.php\/wp-json\/wp\/v2\/categories?post=2317"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/suimy.me\/index.php\/wp-json\/wp\/v2\/tags?post=2317"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}