What is the difference between yum update and upgrade? “yum update” updates all the presently installed packages to their latest versions that are available in the repositories and “yum upgrade” performs the same action as “yum update”, but once finished it also removes all of the obsolete packages from the system.
Steps:
Backup: Create a backup of important data and configuration, so it can be use if something goes wrong in patching
Update Repositories: Install latest repos using "rpm -ivh " command
Check Current Version: cat /etc/redhat-release; yum list updates; rpm -qa --last | grep -i kernel
Review Changelogs: Validate above results and decide which applications needs to be updated and which not
Apply updates: yum update -y; yum update packagname (this is for particular package)
(yum update --exclude=PACKAGENAME or yum update --exclude=kernel*) it will exclude particulars if needed
Reboot : It is often a good idea to perform a reboot to ensure all updates are fully integrated and that is relevant
Check Services : Check and ensure all services are back online
Monitor/Testing: Monitor the server/Services and test all applications or websites
Document: Make a note of the update that we applied.
Patching Rollback
yum history list all - List of previous yum executions, Date, ID etc
yum list update - Which all packages are available for update
ls -l /lib/modules/ - Check modules recently installed
rpm -qa --last | grep -i kernel - Check last kernel using rpm command
yum history undo 10 - Roll back the yum installations just before the pasted ID (It wont rollback kernel)
Boot Problems / Kernel Panic
1. Missing initramfs -
"Error: file '/initramfs-3-10.....' not found
Boot using ISO and Login to rescue mode
mount -o remount,rw /mnt/sysimg
chroot /mnt/sysimage
cd /boot/ ; ls
dracut -f /boot/initramfs-3.10.0,,.....img 3.10......img
Reboot -f
2. Corrupted Grub (RHEL 8/7)
- Grub config : /boot/grub2/grub.cfg
grub> # boot up stuck at this prompt
- Login to rescue mode
- mount /mnt/sysimg
- chroot /mnt/sysimage
- grub2-install /dev/sda #Mostly boot parttition is in the main drive liek
- grub2-mkconfig -o /boot/grub2/grub.cfg
- exit; and boot normally