How to get yum package update notifications via e-mail?

This will work for: Red Hat / CentOS / Fedora
For Debian / Ubuntu: Please visit this website.

My server sends me a notifications for everything what happens on the server through e-mail, the only thing I had to check manually every time were the updates / upgrades for my Linux system. I figured there should be a way to get yum-update send notifications with available upgrades. So what we are going to do now is force yum to send an email when a update or upgrade is available.

First thing we need to do is open the yum config file.

root@server:$ 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 = dbus
# 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

Add these variables, and change “email_to” to your e-mail address:

emit_via = email
# who to send the email to:
email_to = email@example.com
# who send the notifications
email_from = yum-update@yourserver.com

Here is my working config file. You can also just copy and use this one and change the e-mail addresses.

[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
# who to send the email to:
email_to = email@example.com
# who send the notifications
email_from = yum-update@yourserver.com

# 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

After saving the file. Restart notification yum-updatesd service.

root@server:$ /etc/init.d/yum-updatesd restart

E-mail notification sample sent by yum notification.

| More

Comments

  1. 1

    Good to know that such feature exists! Thanks.


    Joshua
    Dec 07th, 2009
  2. 2

    Thanks for you comment Joshua, did you also know that you can have your root mail send to another e-mail address as well? That way you’ll be able to receive all the logs, errors & warnings from your server or linux computer in your inbox.


    Bob
    Dec 08th, 2009