Author Topic: Automatic YUM Updates?  (Read 1883 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Automatic YUM Updates?
« on: February 18, 2024, 01:59:07 AM »
Is there a way to configure CWP Pro to automatically perform YUM updates, instead of starting them manually?

I found a way to configure a YUM cron to automatically install updates, but I don't know if this would have a conflict with CWP.  The link is below.

https://www.howtoforge.com/tutorial/how-to-setup-automatic-security-updates-on-centos-7/

Michael

Offline
*****
Re: Automatic YUM Updates?
« Reply #1 on: February 18, 2024, 11:20:25 PM »
After manually doing updates for about a year, I went ahead and enabled auto updates with yum via cron. So for over a year now, I haven't been bothered with it and haven't been bitten by a bad update. (Major updates like MariaDB need to be manually done.) Occasionally you will get a "ghost" notice of updates being available, but generally this should take care of it for you:

As root, create this script:
/etc/cron.daily/yum

Code: [Select]
#!/bin/sh
# yummy updater
/usr/bin/yum -y update --security

Offline
*
Re: Automatic YUM Updates?
« Reply #2 on: February 19, 2024, 03:45:42 AM »
Thank you for your reply!  Did you install "yum-cron", or are you using just YUM?  It seems like the latter, where you are simply adding the YUM update to the daily jobs.

Michael

Offline
*****
Re: Automatic YUM Updates?
« Reply #3 on: February 19, 2024, 03:07:50 PM »
Yes, the latter -- just adding to the daily jobs. Also, note that permissions on the script need to have the execute bit set. Some of the pre-baked scripts have 700, some have 755 permissions.

Offline
*
Re: Automatic YUM Updates?
« Reply #4 on: February 21, 2024, 04:42:41 AM »
Thank you for the clarification.

Michael

Offline
*****
Re: Automatic YUM Updates?
« Reply #5 on: February 21, 2024, 06:44:42 AM »
@overseer, Thanks You for the little updater script.

I changed it a little for AL 8.
We also use a 3rd party Kernel, which is updated manually for obvious reasons.

What are your thoughts?

--

As root, create this script:
nano /etc/cron.daily/dnf

(Code:)

#!/bin/sh
# Dandified YUM (DNF) Updater
/usr/bin/dnf update --security --exclude=kernel* -y

--

chmod 755 /etc/cron.daily/dnf

ls -l /etc/cron.daily/
« Last Edit: February 21, 2024, 06:51:59 AM by Starburst »

Offline
*****
Re: Automatic YUM Updates?
« Reply #6 on: February 22, 2024, 02:44:45 AM »
Seems good and tuned to your needs. When I get to AlmaLand next month I'll be doing:
Code: [Select]
#!/bin/sh
# Daily DNF Updater
/usr/bin/dnf update --security -y
(Although I did just write the code in my mind for conditionals, testing whether it was for YUM or DNF and branching accordingly -- a Rube Goldberg curse!)

Offline
*****
Re: Automatic YUM Updates?
« Reply #7 on: February 27, 2024, 05:06:57 PM »
For some reason that cron wasn't working. :/

Found dnf-automatic, and have that running on 1 server.

Create a KB article for AlmaLinux 8 and CentOS 7.