I used dpkg --list | grep linux-image to find out I have the following kernel versions:

rc  linux-image-4.18.0-15-generic                4.18.0-15.16~18.04.1                         amd64        Signed kernel image generic
rc  linux-image-4.18.0-25-generic                4.18.0-25.26~18.04.1                         amd64        Signed kernel image generic
ii  linux-image-5.0.0-23-generic                 5.0.0-23.24~18.04.1                          amd64        Signed kernel image generic
ii  linux-image-5.0.0-25-generic                 5.0.0-25.26~18.04.1                          amd64        Signed kernel image generic
ii  linux-image-generic-hwe-18.04                                        amd64        Generic Linux kernel image

I want to add 4.18.0-25 to grub so that it boots into it by default, but I can't figure out where these kernels are located so that I can add them to grub? How can I do that. Also after I identify where the image files are, do I only need to copy them to /boot run sudo update-grub? Or is there more I need to do?

  • Thank you! How can I get the removed kernels back? – Alex Mussell Aug 28 at 22:55
  • That worked thanks! – Alex Mussell Aug 28 at 23:03
  • Once you get the kernel installed, you can look at this answer: askubuntu.com/a/1168445/243321 to see how to set grub to boot into it by default. – Organic Marble Aug 28 at 23:03
  • The OP wants to keep using an older kernel, just wondering if he has to do anything to stop software updater from removing it afterwards? – crip659 Aug 28 at 23:23
  • @crip659 You can mark hold it. Then it never gets auto-removed. – WinEunuuchs2Unix Aug 29 at 1:29

The 'rc' at the beginning of the line means that the package has been removed.
Currently installed packages are the 'ii' lines.

You are looking at the database of packages that dpkg is aware of, installed or not, including packages from the past that have since been removed.

If you really want to re-install an older kernel, there's a good chance that simply telling apt will do the trick: sudo apt install linux-image-4.18.0-25-generic

Since Ubuntu regularly wants to upgrade you to a newer kernel, you can apt-mark the package so it doesn't get removed again: sudo apt-mark hold linux-image-4.18.0-25-generic.

Someday, when you change your mind and DO want to remove the old kernel: sudo apt-mark unhold linux-image-4.18.0-25-generic

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.