How to e-mail the information of packages which can be updated in a system, or how to automatically update packages in a system.

Solution Verified - Updated -

Environment

Red Hat Enterprise Linux 6
Red Hat Enterprise Linux 5

Issue

  • RHN notification mails are often delayed.
  • Are there ways to know packages which can be updated in a system?
  • In addition to notice them, are there ways to update?

Resolution

Use yum-cronm and yum-updatesd in RHEL5 and RHEL6 respectively.

How to setup yum-cron in RHEL6

  1. Add optional channel.

    yum-cron is a optional package, so optional channel needs to be added.

    # rhn-channel -a -c rhel-x86_64-server-optional-6
    
  2. Check optional channel.

    # rhn-channel -l
       rhel-x86_64-server-6
       rhel-x86_64-server-optional-6
    
  3. Install yum-cron

    # yum install yum-cron
    
  4. Edit /etc/sysconfig/yum-cron

    :
    # Don't install, just check (valid: yes|no)
    CHECK_ONLY=no                <--- change "yes" if you want to only check (need "yes" when DOWNLOAD_ONLY is yes)
    
    :
    
    # Don't install, just check and download (valid: yes|no)
    # Implies CHECK_ONLY=yes (gotta check first to see what to download)
    
    DOWNLOAD_ONLY=no                  <--- change "yes" if you want to only download 
    
    MAILTO=                           <--- put a e-mail address
    :
    

    If both "CHECK_ONLY and DOWNLOAD_ONLY" are "no", packages will be updated

  5. Setup to start yum-cron on boot

    # chkconfig yum-cron on
    
  6. Start yum-cron now

    # service yum-cron start
    

How to setup yum-updatesd in RHEL5

  1. Install yum-updatesd

    # yum install  yum-updatesd 
    
  2. Setup to start yum-cron on boot

    # chkconfig yum-updatesd on
    
  3. Edit /etc/yum/yum-updatesd.conf

    [main]
    
    run_interval = 3600  <--------------- setup seconds to chek (Default 3600 seconds = 1 hour)
    :
    # how to send notifications (valid: dbus, email, syslog)
    emit_via = email      <---------------- change "email"
    :
    dbus_listener = no    <----------------  change "no"
    
    email_to = xxxx@example.com      <--- add  To address
    email_from = root@example.com    <--- add  From address
    
    
    # automatically install updates
    do_update = no                      <--- change if you want to update packages 
    # automatically download updates
    do_download = no                    <--- change if you want to only download packages 
    # automatically download deps of updates
    do_download_deps = no               <--- change if you want to download dependency packages
    
  4. Start yum-updatesd

    # service yum-updatesd start
    

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.