Problem with update on Ubuntu 20.04 LTS (kernel upgrade problem) - How I can download updates avoids kernel update?

Asked by Piotr on 2021-02-18

Dear Launchpad Community,

Today I installed Ubuntu 20.04 LTS and I installed updates by terminal (apt upgrade command). This broken my system because this was probably problem with kernel update. My terminal stopped working, graphical environment too, next graphical environment was back but terminal doesn't work, I can't also shut down computer because some errors output was showed. I don't know what errors because I didn't make picture (it is a pity) so I can't tell you what was wrong. I musted power off computer (without command, I used switch on power supply). So I think that focal is not stable. I decided back to the bionic.

I have question to apt command and updates. Why this install always new kernel? How I can do updates without this? I don't want to download kernel automatically. I want to keep my kernel version. How I can do this by terminal and apt command? I suppose that on the update manager it is possible to uncheck kernel update but I want to do this by terminal.

Can you help me?

Question information

English Edit question
Ubuntu Edit question
No assignee Edit question
Last query:
Last reply:
Daniel Letzeisen (dtl131) said : #1

Unless you removed the original Focal kernel, it's probably still installed and you can still boot into it at GRUB menu. So I'd suggest doing that to see if problem(s) persist.

"Why this install always new kernel? "
Because the kernel is a critical component of the system. Updates bring important fixes, including security fixes.

Piotr (peterq94) said : #2

Thanks for your information it is helpful for me but I asked about update without installing new kernel. So how I can do this? Example I installed Ubuntu 20.04 and I want to update to 20.04.1 with 5.4 kernel or to 20.04.2 but with 5.4 kernel. I don't want install 5.8 kernel. How I can do this?

Daniel Letzeisen (dtl131) said : #3

The easiest way is to use a 20.04.1 .iso to install Ubuntu. That will keep you on 5.4.x kernel unless you explicitly install newer HWE kernel series.

Or, if you have an existing 20.04 install that's running 5.8 kernel, you can still move back to 5.4 kernel:
1. Run 'sudo apt-get install linux-generic'
2. Reboot into the 5.4.x kernel from the GRUB menu
3. Run 'sudo apt-get purge linux-headers-generic-hwe-20.04 linux-image-generic-hwe-20.04 linux-headers-5.8* linux-image-5.8*

Piotr (peterq94) said : #4

Okay, thank you for help. I don't have focal installed now so I don't know if it is helpful but I don't ask you how switch back to 5.4. I apreciate that you wrote about this because it is helpful but I want to know what I should do if I want to do updates. Example I want to update firefox program or others packages but I don't want to upgrade kernel version. When I did apt command to update packages they automatically updates my kernel. I want to avoid this. So how I can do update for all packages except packages for kernel release? Do you know something about it?

Manfred Hampl (m-hampl) said : #5

This needs a longer answer, going into some details of package management.

When taking firefox as an example: The name of the package is firefox, and when there is a new version of the package available and you start a package manager update command (either with update-manager, or with apt commands, or by the background job doing automatic-updates), the package management system will see that there is an older firefox package installed and a new one is available, so the newer version will be downloaded and installed. Only one version of the firefox package can be installed at a certain moment.

With kernel packages the case is a bit more complicated, because the kernel packages have the version number in the package name (e.g. linux-image-5.4.0-65-generic, linux-image-5.4.0-66-generic, linux-image-5.8.0-43-generic etc.). This allows installing several different versions of the kernel packages at the same time.

If you now have linux-image-5.4.0-64-generic installed and linux-image-5.4.0-65-generic is available, how does the package management know that it should install the new version?
This is done with so-called meta-packages. The package linux-generic always depends on the newest version of the kernel packages. Whenever a new version of the kernel packages is published, the meta-package is updated to depend on the new version. The package management sees that there is an update for the meta package, wants to install it, and this will - because of dependencies - also install the new kernel version.

In fact there are two families of meta packages available:
linux-generic and linux-generic-hwe-20.04

linux-generic for focal depends on the 5.4.0-* kernel
linux-generic-hwe-20.04 depends on the newest available HWE kernel, and this has recently changed from 5.4.0-* to 5.8.0-* (and will most probably change to 5.10.0-* after publication of Ubuntu 21.04).

If you want to have an Ubuntu focal system with the 5.4 kernel, then you have to make sure that you have the linux-generic meta-package installed, but not one of the the -hwe- packages

Daniel Letzeisen (dtl131) said : #6

"When I did apt command to update packages they automatically updates my kernel."

That should not happen if you used 20.04.1. You should only get updates to the 5.4.x kernel, but not automatic install of HWE kernels. It's hard for me to tell you how to prevent getting a 5.8.x kernel because I'm not sure what commands or program you used that installed a 5.8.x kernel. I use Synaptic myself. It's probably a bit intimidating to less advanced users, but it helps in situations like this. And it helps users learn the package system.

"So how I can do update for all packages except packages for kernel release? Do you know something about it?"

This should be the default behavior for the 20.04 and 20.04.1 iso's. They should only update the minor version of the kernel (i.e the 'x' in 5.4.x) Those are critical/security patches that you want.
 Again, I'm not exactly sure what you did to get 5.8.x.

And again, you need to make sure you use the 20.04.1 iso if you want to stay on the non-HWE kernel path.

Manfred Hampl (m-hampl) said : #7

"apt update" informs about the actions it is going to do. You should have answered "no" to the question "do you want to continue" when you saw that a 5.8.0-* kernel was about to be installed.

Piotr (peterq94) said : #8

I know that apt update informed me about all packages which will be updated. I saw that apt want to install new kernel release and this was my mistake to install this. My version of Ubuntu was 20.04 LTS (first release so this was 24.04.0, not 24.04.1 like mention Mr Daniel Letzeisen).

I know that I should answer no to continue but if apt doesn't work correctly and suggested me 5.8 kernel. How I can do updates? If any updates will be suggest me install new kernel I will be in trouble because I can't get security update.

So this was bug? For first focal release I should't get update for 5.8 kernel from apt?

Manfred Hampl (m-hampl) said : #9

For a reason not know to me you must have had a kernel-meta package installed that caused installing the 5.8 kernel.
If you install focal again and want to avoid an upgrade to kernel version 5.8, then you have to make sure that you do not have a kernel-meta package installed that depends on the 5.8 kernel, but only the meta-packages that depend on 5.4.
If that is set, then upgrading will not install the 5.8 version, but all other updates that are available.

Can you help with this problem?

Provide an answer of your own, or ask Piotr for more information if necessary.

To post a message you must log in.