While working on a script, I ran into a recurring OpenSSL installation error on RHEL 9.4 after switching the system to Rocky 9.4 repositories. At first, there was very little useful explanation available, and I could not find a clear precedent for it. The root of the issue turned out to be a package conflict involving openssl-libs and openssl-fips-provider.
The key problem is that both openssl-fips-provider and openssl-libs provide the same file:
/usr/lib64/ossl-modules/fips.so
At least before openssl-libs-1:3.0.7-27, Rocky shipped or bundled content in openssl-libs, while RHEL built openssl-libs and openssl-fips-provider separately, splitting some components into the latter package. Once RHEL 9 uses Rocky repositories, that packaging difference can cause file conflicts during OpenSSL-related installation or upgrade operations.
After testing and combining a few commands, I resolved the conflict by forcibly removing the conflicting package and then reinstalling the matching RPMs:
``` 1 2 3 rpm -e --nodeps openssl-fips-provider yum install https://shell.nuoyis.net/download/openssl-devel-3.0.7-27.el9.0.2.x86_64.rpm yum install https://shell.nuoyis.net/download/openssl-libs-3.0.7-27.el9.0.2.x86_64.rpm
After that, the problem was cleared up and the system was able to boot normally again.
If the machine still fails to boot properly after reboot, the reason may be the UEFI boot mode. After some testing and investigation, the following solution can be used:
``` 1 2 3 4 5 6 7 8 9 10 11 12
if [ -d /sys/firmware/efi ] && [ -d /boot/efi/EFI/redhat ];then
echo "你的Boot分区为EFI,正在进行特别优化"
mv /boot/efi/EFI/redhat/ /boot/efi/EFI/rocky
bootid=$(efibootmgr | grep BootCurrent | egrep -o "[0-9]+")
efi_uuid=$(efibootmgr -v | grep -A 1 "Boot"$bootid | egrep -o '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}')
efi_id=$(lsblk -o NAME,UUID,PARTUUID | grep $efi_uuid | egrep -o '[n|v][[:alnum:]]+')
diskname=$(echo $efi_id | sed 's/[0-9]*$//; s/p[0-9]*$//')
efi_disknumber=$(echo $efi_id | egrep -o '[0-9]$')
sudo efibootmgr -b $bootid -B
sudo efibootmgr --create --disk "/dev/$diskname" --part $efi_disknumber --label "nuoyis-redhat Linux" --loader "\EFI\rocky\shimx64.efi"
sudo grub2-mkconfig -o /boot/efi/EFI/rocky/grub.cfg
fi
That logic has already been added to an initialization script, so RHEL 9 users can run it directly during system setup:
curl -sSO https://shell.nuoyis.net/nuoyis-init.sh;bash nuoyis-init.sh