How to Keep Systems Up to Date for CentOS / RHEL / Fedora

As a system administrator, we generally need to keep our systems up to date with most recent packages. It’s hard to go to server daily and check for available bundles. For this we can utilize yum-updatesd service to get email notices or we can similarly configure this service to upgrade any packages automatically when available.

Yum-updatesd can be configured with couple of easy steps given below. You may also need to install top yum repositories which provide latest packages.

Install/Update yum-updatesd Package

By default this package installed on system time. So better to update this package before configure it.

yum update yum-updatesd

Configure yum-updatesd

You can change the configuration file as per your requirements by using your favorites editor:

# nano /etc/yum/yum-updatesd.conf
[main]
# how often to check for new updates (in seconds)
run_interval = 3600
# how often to allow checking on request (in seconds)
updaterefresh = 600

# how to send notifications (valid: dbus, email, syslog)
emit_via = email

# Put your mail address
email_to = [email protected]

# who send the notifications
email_from = [email protected]

# should we listen via dbus to give out update information/check for
# new updates
dbus_listener = yes

# automatically install updates
 do_update = no
 # automatically download updates
 do_download = no
 # automatically download deps of updates
 do_download_deps = no

Exclude Some Packages from Auto Update

May be some of packages we don’t need to auto update until more specific reason, for example PHP and MySQL. To do it edit /etc/yum.conf file.

nano /etc/yum.conf

And add the following line under main section.

exclude=php* kernel* mysql* httpd*

Restart yum-updatesd Service

You can use below command to restart yum-updatesd service and enable auto start on system boot.

# /etc/init.d/yum-updatesd restart
# chkconfig yum-updatesd on

Now you will receive an email to your mailbox with information of packages available for update.