{"id":108,"date":"2021-07-30T00:24:53","date_gmt":"2021-07-30T00:24:53","guid":{"rendered":"https:\/\/www.hostduplex.com\/kb\/?post_type=ht_kb&#038;p=108"},"modified":"2021-07-30T00:35:57","modified_gmt":"2021-07-30T00:35:57","slug":"enable-automatic-yum-updates-in-centos-7","status":"publish","type":"ht_kb","link":"https:\/\/www.hostduplex.com\/kb\/article\/enable-automatic-yum-updates-in-centos-7\/","title":{"rendered":"Enable Automatic YUM Updates in CentOS 7"},"content":{"rendered":"\n<p>This tutorial describes how to configure automatic system updates via YUM on CentOS 7. Given today&#8217;s cybersecurity climate, security hygiene has never been more important. Keeping your system up-to-date will help keep your server patched and prevent attacks. <\/p>\n\n\n\n<p><p><strong>AUTOMATIC INSTALLATION (Single command):<\/strong><\/p><pre>yum -y install yum-cron ; echo 'exclude=kernel*' >> \/etc\/yum.conf ; sed -i s\/\"apply_updates = no\"\/\"apply_updates = yes\"\/g \/etc\/yum\/yum-cron.conf ; systemctl start yum-cron.service ; service enable yum-cron<\/pre><\/p>\n\n\n\n<p><strong>MANUAL INSTALLATION: <\/strong><\/p>\n\n\n\n<p><strong>Step 1:<\/strong> Install the yum-cron package<\/p>\n\n\n\n<p><pre>yum -y install yum-cron<\/pre><\/p>\n\n\n\n<p><strong> Step 2 (Optional):<\/strong> Add an exclusion rule for the kernel in \/etc\/yum.conf<\/p>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-info\">We recommend excluding the kernel as your \/boot partition may become full.  Manual kernel updates are advised. <\/p>\n\n\n\n<p><pre>echo 'exclude=kernel*' &gt;&gt; \/etc\/yum.conf<\/pre><\/p>\n\n\n\n<p><p><strong> Step 3: <\/strong>Modify \/etc\/yum\/yum-cron.conf and switch <em>apply_updates<\/em> to <em>yes<\/em> by executing the following command<span style=\"font-size: revert; color: initial; font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &quot;Helvetica Neue&quot;, sans-serif;\"> <\/span><\/p><pre>sed -i s\/\"apply_updates = no\"\/\"apply_updates = yes\"\/g \/etc\/yum\/yum-cron.conf<\/pre><\/p>\n\n\n\n<p><p><strong> Step 4:<\/strong> Start the yum-cron service:<\/p><pre>systemctl start yum-cron.service<\/pre><\/p>\n\n\n\n<p><p><strong> Step 5:<\/strong> Enable yum-cron at boot:<\/p><pre>systemctl enable yum-cron<\/pre><\/p>\n\n\n\n<p><br><strong> Congratulations, you have now enabled automatic yum updates.<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial describes how to configure automatic system updates via YUM on CentOS 7. Given today&#8217;s cybersecurity climate, security hygiene has never been more important. Keeping your system up-to-date will help keep your server patched and prevent attacks. AUTOMATIC INSTALLATION (Single command): yum -y install yum-cron ; echo &#8216;exclude=kernel*&#8217; >>&#8230;<\/p>\n","protected":false},"author":2,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"ht-kb-category":[18],"ht-kb-tag":[],"class_list":["post-108","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-centos-7"],"_links":{"self":[{"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/ht-kb\/108","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/comments?post=108"}],"version-history":[{"count":5,"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/ht-kb\/108\/revisions"}],"predecessor-version":[{"id":116,"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/ht-kb\/108\/revisions\/116"}],"wp:attachment":[{"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/media?parent=108"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/ht-kb-category?post=108"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/ht-kb-tag?post=108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}