Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using CentOS and Red Hat Enterprise Linux on a few machines without the GUI. How can I check if recently installed updates require a reboot? In Ubuntu, I'm used to checking if /var/run/reboot-required is present.

share|improve this question
up vote 6 down vote accepted

You could compare the ouput of uname -a with the list of installed kernel packages

share|improve this answer
Is a different kernel the only reason a linux server would need a reboot? – Chris_K Mar 16 '10 at 15:57
Normally, when staying within the 'normal' package upgrade processes (up2date, yum etc.), there shouldn't be really many other reasons to reboot the system besides the kernel upgrade – Dominik Mar 19 '10 at 14:35
I suspect that certain other packages may require a reboot eben iof the kernel does not change (when I installed kexec-tools-2.0.0-258 on centos6.0 there was no memory reserved for the dump) – nhed Aug 29 '13 at 19:25
BeyondTrust's pbis-open package requests the user to reboot after installation via stdout. – bshacklett Feb 13 '15 at 19:41

About comparing installed kernels with running one:

LAST_KERNEL=$(rpm -q --last kernel | perl -pe 's/^kernel-(\S+).*/$1/' | head -1)
CURRENT_KERNEL=$(uname -r)


Hope that helps!

share|improve this answer
At first I thought this wasn't working as it continued to tell me to reboot after I had, but then found out that if you are using a DigitalOcean instance, you need to manually change the kernel from their control panel first before rebooting. – Programster Aug 17 '14 at 12:12

One thing that can be helpful to look at in terms of "is a reboot required" is whether or not there are any files that have been removed/replaced by the update but for which the old files are still loaded/used by active processes.

Basically, when YUM updates a file that is in use by a process, the file itself may have been marked for deletion, but the process keeps using the old file since it has an open file-descriptor to the old file's inode.

A command to get a count of the number of old files still in use:

#lsof | grep "(path inode=.*)" | wc -l

That command will give you a count of the files.

Use this instead to see which files are actually in use:

#lsof | grep "(path inode=.*)"

That command will produce output similar to the following on a YUM-updated box:

sshd      3782   root  mem       REG   8,17          153427 /lib64/ (path inode=153253)
mysqld    3883  mysql  mem       REG   8,17          153259 /lib64/ (path inode=153402)
mingetty  4107   root  mem       REG   8,17          153243 /lib64/ (path inode=153222)
share|improve this answer

Check whether running kernel is the latest one.

If it's not, check whether system was restarted since kernel install.

If it was not, reboot.

CURRENT_KERNEL="$(rpm -q kernel-$(uname -r))"
test -z "$CURRENT_KERNEL" && exit 0     # Current kernel is a custom kernel

LATEST_KERNEL="$(rpm -q kernel | tail -1)"
test -z "$LATEST_KERNEL" && exit 0      # No kernel package installed

LATEST_KERNEL_INSTALLTIME=$(rpm -q kernel --qf "%{INSTALLTIME}\n" | tail -1)
test -z "$LATEST_KERNEL_INSTALLTIME" && exit 1      # Error reading INSTALLTIME

test "$CURRENT_KERNEL" = "$LATEST_KERNEL" && exit 0 # Latest kernel running, no reboot needed

BOOTTIME="$(sed -n '/^btime /s///p' /proc/stat)"
test -z "$BOOTTIME" && exit 1           # Error reading BOOTTIME

test "$LATEST_KERNEL_INSTALLTIME" -lt "$BOOTTIME" && exit 1 # Latest kernel not running, but system was restarted already
                                        # User switched back to an old kernel?

echo reboot
share|improve this answer
This doesn't work if you have a PAE enabled kernel version. The uname -r comamnd returns the PAE suffix after the .elX part but not the rpm names. – Yanick Girouard Sep 13 '13 at 15:41

install.log install.log.syslog yum.log you check this place what all got new rpm got install

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.