How to fix “iproute conflicts with kernel” issue

The recent version of the iproute package is not supported by some old kernels so it brought a new conflict to updates.

The symptoms are the following messages in a yum update or a control panel update script:

iproute-4.11.0-30.el7.cloudlinux.x86_64 conflicts kernel < 3.10.0-793.21.1.lve1.5.20

Error: iproute conflicts with 1:kernel-3.10.0-xxx.xx.x.xxxx.x.xx.el7.x86_64

First of all, check what kernel is currently loaded on the server:

uname -a

1). If the currently loaded kernel is mentioned in the conflict error message, it means that the kernel you are using is outdated and it does not support the new iproute package. In this case, you need to update your kernel and server components, using the following command:

yum update kernel

Once confirmed running up to date kernel, list current kernel packages:

rpm -q kernel kernel-plus

When the newest kernel is installed, reboot the server to apply the new kernel and check it again with uname -a command. On rare occasions, you will need to choose which kernel to load manually if it does not load automatically,

2). If your current kernel is different from the kernel(s) in the error message and it is newer, you can safely delete the outdated kernel(s) from the server:

yum remove kernel-3.10.0-xxx.xx.x.xxxx.x.xx.el7.x86_64

Where “xxx.xx.x.xxxx.x.xx” is a certain kernel version number. If there are more than one outdated kernels in the error messages, then you should remove all of them.

The issue with the yum update will be resolved once the outdated kernels are removed.

P.S. Instead of deleting conflicting kernels, you can also add the iproute package to the excludes of yum in /etc/yum.conf file, then the iproute package won’t be marked for the update. It can be useful when you need to perform an update but can’t reboot the server at the given moment. It can be excluded manually using a preferred text editor or using the following command:

sed -i 's/exclude=/exclude=iproute /' /etc/yum.conf

The change can be reverted using this command:

sed -i 's/exclude=iproute /exclude=/' /etc/yum.conf