Skip to content

Instantly share code, notes, and snippets.

@chroming
Last active September 9, 2024 04:46
Show Gist options
  • Save chroming/7ec74cd145e12e7fd64c4d0da929a336 to your computer and use it in GitHub Desktop.
Save chroming/7ec74cd145e12e7fd64c4d0da929a336 to your computer and use it in GitHub Desktop.
Downgrade linux kernel in Ubuntu22

Ubuntu Kernel Rollback Steps

  1. Check current kernel version:

    uname -r
    
  2. List installed kernels:

    dpkg --list | grep linux-image
    

3.a Option 1: Use GRUB menu

  • Reboot system
  • Press Shift or Esc to access GRUB menu
  • Select "Advanced options for Ubuntu"
  • Choose the desired older kernel version
  • Boot into the selected kernel

3.b Option 2: Modify GRUB default

  • Edit GRUB configuration:
    sudo nano /etc/default/grub
    
  • Modify GRUB_DEFAULT line:
    GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux X.X.X-XX-generic"
    
  • Update GRUB:
    sudo update-grub
    
  1. Remove new kernel

    • Identify new and old kernel versions
    • Remove new kernel:
      sudo apt remove linux-image-[new-version] linux-headers-[new-version]
      
    • Update GRUB:
      sudo update-grub
      
  2. Reboot system

  3. Verify kernel version after reboot:

    uname -r
    

Note: Always ensure at least one working kernel remains installed. Back up important data before making system changes.

Install linux kernel

apt install linux-image-6.8.0-40-generic linux-headers-6.8.0-40-generic linux-modules-6.8.0-40-generic linux-modules-extra-6.8.0-40-generic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment