Select Your Language

Infrastructure and Management

Cloud Computing

Storage

Runtimes

Integration and Automation

  • Comments
  • yum update during reboot in RHEL 7

    Posted on

    Any ideas here:
    server needs to perform 'yum update -y' during reboot so that new kernel is automatically installed and patched to latest version. I tried below in RHEL 7 but not working:
    [Unit]
    Description=Yum udpates
    Before=systemd-reboot.service
    DefaultDependencies=no
    [Service]
    ExecStart=/usr/bin/yum update -y
    Type=forking
    [Install]
    WantedBy=reboot.target

    when i change WantedBy=multi-user.target its working but that's when server is coming up which doesn't help.

    expect to see: yum update needs to run when server is going down(not when server is coming up) so that upon reboot server boots with new kernel.

    by

    points

    Responses

    Red Hat LinkedIn YouTube Facebook X, formerly Twitter

    Quick Links

    Help

    Site Info

    Related Sites

    © 2026 Red Hat