Hi Elsayed, Omar ,
Thank You for your patience and please follow below given instructions.
The error which was stated above "Kernel Panic due to Missing Initramfs" can occur due to corrupted or missing initramfs for the newer kernel, I have shared troubleshooting steps that I felt will help resolve the issue you reported.
To resolve the error, we should regenerate it from the older kernel (i.e working environment) can likely be a possible solution. Since you are trying from older kernel and you stated above as you still not able to login to older kernel also, you can try with booting into recovery mode option which provides a minimal environment to access and modify the system to regenerate the initramfs. Please use below documentation below for detailed steps:
https://wiki.ubuntu.com/RecoveryMode
After that please try with below commands to regenerate the initramfs;
- First verify the kernel version, uname -r
- sudo update-initramfs -u -k all (Debian/Ubuntu Linux distribution systems) dracut -f /boot/initramfs-<kernelVersion>.img <kernelVersion> (CentOS, RHEL, Fedora and others Linux distribution systems)
- After regenerating, update GRUB bootloader to ensure that it uses the correct kernel and initramfs sudo update-grub (Debian/Ubuntu Linux distribution systems) sudo grub2-mkconfig -o /boot/grub2/grub.cfg (CentOS, RHEL, Fedora and others Linux distribution systems)
If you found this informative, please consider accepting an answer as a token of appreciation. And don't forget to give it a thumbs up 👍 if it was helpful.