rpm包安装失败,问题追踪
1. 装包记录
安装失败,提示内核问题
rpm -ivh quadstor-virt-3.2.24-rhel.x86_64.rpm Verifying... ################################# [100%] Preparing... ################################# [100%] usermod -G vtprocgrp apache > /dev/null 2>&1 Kernel build dir /lib/modules/4.18.0-348.el8.x86_64/build/ does not seem to be valid. Cannot continue. If you have done a kernel upgrade, rebooting might help. error: %prein(quadstor-virt-3.2.24-rhel.x86_64) scriptlet failed, exit status 1 error: quadstor-virt-3.2.24-rhel.x86_64: install failed
2. 查看安装详情
rpm --scripts -qp quadstor-virt-3.2.24-rhel.x86_64.rpm >install.script less install.script
preinstall scriptlet (using /bin/sh): .... kbuilddir="/lib/modules/`uname -r`/build/" if [ ! -f $kbuilddir/Makefile ]; then echo "Kernel build dir $kbuilddir does not seem to be valid. Cannot continue." echo "If you have done a kernel upgrade, rebooting might help." exit 1 fi
...
postinstall scriptlet (using /bin/sh):
...
...
preuninstall scriptlet (using /bin/sh):
...
...
postuninstall scriptlet (using /bin/sh):
...
...
发现问题,内核模块小版本对应不上了。。。
# less /usr/lib/modules/4.18.0-348.el8.x86_64/build /usr/lib/modules/4.18.0-348.el8.x86_64/build: No such file or directory # ll -d /usr/lib/modules/4.18.0-348.el8.x86_64/build lrwxrwxrwx. 1 root root 38 Oct 19 2021 /usr/lib/modules/4.18.0-348.el8.x86_64/build -> /usr/src/kernels/4.18.0-348.el8.x86_64 # ls /usr/src/kernels/4.18.0-348.el8.x86_64 ls: cannot access '/usr/src/kernels/4.18.0-348.el8.x86_64': No such file or directory
# ls /usr/src/kernels/
4.18.0-348.7.1.el8_5.x86_64
解决:升级所有内核模块到同一个版本