apt/HWE Kernel NOT offer v7.0 install. Keep current v6.17 kernel indefinitely

Ubuntu Version

Ubuntu 24.04 LTS Flavors

Desktop Environment (if applicable)

Cinnamon

Problem Description

Need to install (just try it for now) most recent version of v7.0 HWE kernel (or whatever is current kernel in 24.04) and keep INDEFINITELY currently installed (likely manually) 6.17.0-14.
Pretty happy with the current v6.17.0-14 kernel, and would like to keep for a while, until I remove it manually (i.e. it should NOT be removed by autoremove).

sudo apt update

Does NOT offer any kernel update to v7.0 kernel (for a long time). Why?

apt list --installed |grep “linux-image”

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
linux-image-6.17.0-14-generic/noble-updates,noble-security,now 6.17.0-14.14~24.04.1 amd64 [installed]

sudo apt-mark showhold

returns nothing.

sudo apt-mark manual linux-image-6.17.0-14-generic
linux-image-6.17.0-14-generic was already set to manually installed.

This older thread might give more context:

Thank you.

Relevant System Information

Linux thinkbookg7 6.17.0-14-generic #14~24.04.1-Ubuntu.

Error Messages / Logs

ls /boot/
config-6.17.0-14-generic  initrd.img-6.17.0-14-generic  memtest86+ia32.efi            vmlinuz
efi                       initrd.img.old                memtest86+x64.bin             vmlinuz-6.17.0-14-generic
grub                      lost+found                    memtest86+x64.efi             vmlinuz.old
initrd.img                memtest86+ia32.bin            System.map-6.17.0-14-generic


What I’ve Tried

sudo apt-mark unhold linux-generic-hwe-24.04 linux-headers-generic-hwe-24.04 linux-image-generic-hwe-24.04
Place your right index finger on the fingerprint reader
linux-generic-hwe-24.04 was already not on hold.
linux-headers-generic-hwe-24.04 was already not on hold.
linux-image-generic-hwe-24.04 was already not on hold.

You machine should see the following, assuming you have repositories listed in your sources and also enabled..

 linux-image-generic-hwe-24.04      | 6.8.0-31.31            | noble             | amd64, arm64, armhf, ppc64el, s390x
 linux-image-generic-hwe-24.04      | 7.0.0-38.38~24.04.4    | noble-security    | amd64, arm64, armhf, ppc64el, s390x
 linux-image-generic-hwe-24.04      | 7.0.0-38.38~24.04.4    | noble-updates     | amd64, arm64, armhf, ppc64el, s390x
 linux-image-generic-hwe-24.04      | 7.0.0-39.39~24.04.1    | noble-proposed    | amd64, arm64, armhf, ppc64el, s390x

The noble line will be what is detected if you’re using one of the architectures listed on that line, and you only have noble repository in your sources enabled.

If you have noble-security source and its enabled, your machine will see that line, likewise if you have noble-updates source and its enabled you’ll detect that.

You do mention running sudo apt update, but do not mention checking that output to ensure no lines of output are missing, no warnings or errors, but key is missing lines of output can be your problem.

Ubuntu Cinnamon is a Ubuntu [Desktop] flavor, and depending on what install media you installed with, the default kernel was GA being linux-generic (ie. no HWE kernel package installed is expected!), or HWE or linux-image-generic-hwe-24.04 which is kernel detail I showed before. Ubuntu Cinnamon released 2 ISOs that installed the GA kernel, and 4 that provided the HWE kernel for the 24.04 release (point release media dictate if it was HWE, ie. .2 & later are HWE, initial & .1 ISO/images installed GA kernel stack).

Have you checked your sources, and actually read the output of commands like sudo apt update to ensure there are no errors, warnings and rather critically in your case - no missing lines in that output! I have seen a few users of late with disabled sources for -updates, -security as a result of performing AI fixes they grabbed online, or adding third party software (which I suspect auto-changed their sources)

4 Likes

There are only errors related to THIRD party software irrelevant to Ubuntu’s repos. Couldn’t find any error related to any of Ubuntu’s repo.

sudo
 apt update                                                                                                            
Place your right index finger on the fingerprint reader                                                                
Hit:1 http://us.archive.ubuntu.com/ubuntu noble InRelease                                                              
Hit:2 http://us.archive.ubuntu.com/ubuntu noble-updates InRelease                                                      
Hit:3 https://dl.winehq.org/wine-builds/ubuntu noble InRelease                                                         
Hit:4 http://us.archive.ubuntu.com/ubuntu noble-backports InRelease                                                    
Hit:5 http://security.ubuntu.com/ubuntu noble-security InRelease                                                      
Hit:6 http://download.opensuse.org/repositories/home:/Alexx2000:/doublecmd-svn/xUbuntu_24.04  InRelease
...

I’d rather not disclose the whole list of repos sorry, hopefully the above provides enough info. I don’t use AI at all.

cat /etc/apt/sources.list.d/ubuntu.sources
Types: deb
URIs: http://us.archive.ubuntu.com/ubuntu/
Suites: noble noble-updates noble-backports
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

Types: deb
URIs: http://security.ubuntu.com/ubuntu/
Suites: noble-security
Components: restricted multiverse universe main
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

Do you mean “apt list |grep “linux-image” or smth else?

Just remembered that I had to manually remove older 6.8 kernel with apt, but its been months ago. No sure if it may be relevant.

Got some progress with 7.0, so the above info is no longer correct/relevant. The only remaining question is how to keep 6.17.0-14 kernel installed (while running v7.0 kernel).

This was only partially answered in the old thread.

I guess I’ll have to get back to this topic later.

Ubuntu will always keep two kernels.
If you update sources and upgrade the OS via these terminal commands, then nothing will be removed without the user’s permission.

sudo apt update
sudo apt upgrade

It is often suggested that sudo apt full-upgrade is a preferred command for many users, so I’ve added a bit more info.
As always, it is user choice.

Command Dependency Info
sudo apt upgrade Upgrading existing packages. New packages will be installed if required to satisfy dependencies but existing packages will never be removed.
sudo apt full-upgrade Upgrading all packages, even if it means installing new dependencies or removing conflicting, older packages

Full information available via the manpage entries.

I noticed that you have Hit:6 http://download.opensuse.org/repositories/.
Assuming that you have other third party sources enabled, you’ll have to pay very close attention when using update and upgrade terminal commands.

Looking at linux-image packages is almost always the wrong place to look at in the dependency chain of kernel packages, updates are solely handled by the top level meta package that you need to have (and keep!) installed for kernel updates to function.

For the GA kernel this is linux-generic for the HWE one it is linux-generic-hwe-${release-version} … i.e. linux-generic-hwe-24.04 for 24.04 …

Check that you have the right one installed …

2 Likes

That’s incorrect. That is apt-get behavior. apt will install new packages when new dependencies appear. Otherwise no kernel update would ever be installed.

Not sure about removal though.

The apt manpage entry:

upgrade - is used to install available upgrades of all packages currently installed
on the system from the sources configured via sources.list(5).
New packages will be installed if required to satisfy dependencies,but existing
packages will never be removed. If an upgrade for a package requires the removal
of an installed package the upgrade for this package isn’t performed.

Vs the apt-get manpage entry:

upgrade - is used to install the newest versions of all packages currently installed
on the system from the sources enumerated in /etc/apt/sources.list. Packages
currently installed with new versions available are retrieved and upgraded; under
no circumstances are currently installed packages removed, or packages not already
installed retrieved and installed. New versions of currently installed packages that
cannot be upgraded without changing the install status of another package will be
left at their current version. An update must be performed first so that apt-get
knows that new versions of packages are available.

When a package is supplied as an argument, the package will be installed prior to the upgrade action.

@ogra and @avb66
I’ve amended the little table in my post to better reflect upgrade

This doesn’t guarantee it will keep 6.17.0-14 kernel installed. I believe by default it will keep 2 consecutive versions of 7.0 kernel and (if one updates via GUI) it will remove 6.17.0-14 kernel sooner or later.

One can uncheck kernel removal of course, but its just a matter of time when one forgets to uncheck it. Also update GUI often hangs or gets super slow when one changes anything (at least in 24.04 Cinnamon).

It wouldn’t be a big deal if my dock didn’t cause kernel panic with other kernel versions (which doesn’t seem easy to troubleshoot). Unfortunately dock’s FW update requires very particular laptops (and years also).

apt will not auto remove the currently running kernel. I understand that you want to always use this kernel forever, because newer versions have some problem. So, presumably you will be running it most of the time.

Also, apt should not auto remove packages installed manually, and you said

To be on safe side you can hold it. This should prevent auto-removal:

apt-mark hold linux-image-6.17.0-14-generic linux-modules-6.17.0-14-generic linux-tools-6.17.0-14-generic
1 Like

Consider:

andrei@resolute:~$ apt list '~i !~M ~nlinux-image-'
linux-image-7.0.0-14-generic/resolute,now 7.0.0-14.14 amd64 [installed]
linux-image-7.0.0-15-generic/resolute-updates,resolute-security,now 7.0.0-15.15 amd64 [installed]
linux-image-7.0.0-22-generic/resolute-updates,resolute-security,now 7.0.0-22.22 amd64 [installed]
linux-image-7.0.0-27-generic/resolute-updates,resolute-security,now 7.0.0-27.27 amd64 [installed]
andrei@resolute:~$ sudo apt autoremove
Summary:
  Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 0
andrei@resolute:~$ sudo apt-mark auto linux-image-7.0.0-15-generic linux-image-7.0.0-22-generic linux-image-7.0.0-27-generic
linux-image-7.0.0-15-generic set to automatically installed.
linux-image-7.0.0-22-generic set to automatically installed.
linux-image-7.0.0-27-generic set to automatically installed.
andrei@resolute:~$ apt list '~i !~M ~nlinux-image-'
linux-image-7.0.0-14-generic/resolute,now 7.0.0-14.14 amd64 [installed]
andrei@resolute:~$ sudo apt autoremove
REMOVING:
  linux-image-7.0.0-15-generic  linux-main-modules-zfs-7.0.0-15-generic  linux-modules-7.0.0-15-generic

Summary:
  Upgrading: 0, Installing: 0, Removing: 3, Not Upgrading: 0
  Freed space: 187 MB

Continue? [Y/n]

Updating via the GUI doesn’t guarantee the unintentional removal of a package.
Click next, click next, click next (without reading every message) is the culprit.
Often referred to as muscle memory or click fatigue.

The best guarantee is apt via the terminal where the user with sudo privileges exercises due care and attention.

1 Like

I wasn’t precise above sorry. I want to KEEP 6.17.0-14 forever (only as a backup) simply b/c this was the only version I found (among 6.17) to not cause kernel panic with my dock. I haven’t tried anything after 6.17 yet.

Hibernate was also hit or miss with other 6.17 versions (which I hope to improve with newer kernel versions).

I do want to try newer kernel versions (and move to it if it works).

This laptop is relatively recent (and not designed for Linux, its designed solely for WIN), so newer kernel(s) are very welcome.

Lenovo was very clear that it will NOT support anything related to Linux (despite premium warranty) even if its a non-OS related keyboard controller issue.

I already have 7.0.0-38 installed, but haven’t rebooted yet.

I have been in a similar situation as you, where a new kernel caused me a problem (bluetooth in my case). It prompted me to create a Tip & Trick

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.