Update Manager not showing 4.17 kernel in list of kernels

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Nick Payne
Level 3
Level 3
Posts: 104
Joined: Sun Feb 21, 2010 8:49 pm

Update Manager not showing 4.17 kernel in list of kernels

Post by Nick Payne »

I just updated from Mint 18.3 to Mint 19 (reformat and clean install). I've installed the 2.17.5 kernel from http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.17.5/ and booted it, but when I run Update Manager and select "Linux Kernels" from the View menu, only the 4.15 kernels appear. I also had the 2.17 kernel installed and running on 18.3, and the Update Manager in that version *did* show the 2.17 kernels installed from the same location when asked to show Linux Kernels. Here's a couple of screen grabs from Mint 19, showing the running kernel and the Kernels dialog box in Update Manager:

Code: Select all

nick@nick-mint:~$ uname -a
Linux nick-mint 4.17.5-041705-generic #201807081431 SMP Sun Jul 8 14:33:41 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
kernels.png
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
smurphos
Level 18
Level 18
Posts: 8501
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: Update Manager not showing 2.17 kernel in list of kernels

Post by smurphos »

I'm guessing this is something to do with package format - the current 4.15 ubuntu supported kernels are delivered to mint as 5 packages - ubuntu have made a lot of changes here recently and mintupdate was adapted to deal with them. It looks like the mainline kernel builds are based on 4 packages.

Which packages did you install in total for 4.17.5? Please post back the output of dpkg -l | grep "linux\-[a-z]*\-"


You are not the first to notice this - https://github.com/linuxmint/mintupdate/issues/356
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
User avatar
trytip
Level 14
Level 14
Posts: 5371
Joined: Tue Jul 05, 2016 1:20 pm

Re: Update Manager not showing 2.17 kernel in list of kernels

Post by trytip »

it will only show up if you use ukuu
Image
User avatar
smurphos
Level 18
Level 18
Posts: 8501
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: Update Manager not showing 2.17 kernel in list of kernels

Post by smurphos »

trytip wrote: Sat Jul 14, 2018 2:16 am it will only show up if you use ukuu
Manually installed mainline kernels used to show in update manager prior to the fixes applied to mintupdate to support the new 4.15 kernel packaging conventions. I'm pretty sure the underlying issue is that current mintupdate doesn't recognise the mainline package naming format linux-image-unsigned-$version$-generic

Mintupdate appears to be looking for the format linux-image-$version$-generic.
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
User avatar
trytip
Level 14
Level 14
Posts: 5371
Joined: Tue Jul 05, 2016 1:20 pm

Re: Update Manager not showing 2.17 kernel in list of kernels

Post by trytip »

it was easier for me to use ukuu then try to figure out which mainline files i needed. ukuu did it all with no issues. i made a big ooopsy while ukuu was installing 4.17.5 i wanted to copy that format , but as soon as i hit ctrl+c to copy :lol: the ukuu terminal command said Error: something dpkg. my brain was not working ctrl+c aborts any and most operations in terminal. it was able to remove and install again. good idea not to play with the keyboard while terminal is doing surgery
Image
User avatar
smurphos
Level 18
Level 18
Posts: 8501
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: Update Manager not showing 2.17 kernel in list of kernels

Post by smurphos »

Does ukuu handle mainline kernel removal as well?
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
gm10

Re: Update Manager not showing 2.17 kernel in list of kernels

Post by gm10 »

smurphos wrote: Sat Jul 14, 2018 2:20 am
trytip wrote: Sat Jul 14, 2018 2:16 am it will only show up if you use ukuu
Manually installed mainline kernels used to show in update manager prior to the fixes applied to mintupdate to support the new 4.15 kernel packaging conventions. I'm pretty sure the underlying issue is that current mintupdate doesn't recognise the mainline package naming format linux-image-unsigned-$version$-generic

Mintupdate appears to be looking for the format linux-image-$version$-generic.
Basically that, it doesn't handle unsigned Ubuntu kernels in the repos, either. In fact it is hardcoded to look at only package names starting with "linux-image-3" or "linux-image-4". It's a rather limited piece of code in that regard.
User avatar
smurphos
Level 18
Level 18
Posts: 8501
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: Update Manager not showing 2.17 kernel in list of kernels

Post by smurphos »

gm10 wrote: Sat Jul 14, 2018 3:30 am Basically that, It doesn't handle unsigned Ubuntu kernels in the repos, either. In fact it is hardcoded to look at only packages starting with "linux-image-3" or "linux-image-4". It's a rather limited piece of code in that regard.
Thank-you gm10 - that explains why my attempt this morning to locally patch mint-update to fix this didn't work....time to try again.
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
gm10

Re: Update Manager not showing 2.17 kernel in list of kernels

Post by gm10 »

smurphos wrote: Sat Jul 14, 2018 3:34 am
gm10 wrote: Sat Jul 14, 2018 3:30 am Basically that, It doesn't handle unsigned Ubuntu kernels in the repos, either. In fact it is hardcoded to look at only packages starting with "linux-image-3" or "linux-image-4". It's a rather limited piece of code in that regard.
Thank-you gm10 - that explains why my attempt this morning to locally patch mint-update to fix this didn't work....time to try again.
It's a few files you'll need to patch, checkKernels.py, kernelwindow.py and Classes.py at first glance.
User avatar
smurphos
Level 18
Level 18
Posts: 8501
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: Update Manager not showing 2.17 kernel in list of kernels

Post by smurphos »

Yep - limited success with my limited python knowledge - I can display all unsigned kernels (including the 4.15 ones) or none at all. It doesn't look pretty.... :roll: I might come back to this if I decide I need a challenge and the issue hasn't been properly patched already. it wasn't on my to do list.... :)
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
gm10

Re: Update Manager not showing 2.17 kernel in list of kernels

Post by gm10 »

smurphos wrote: Sat Jul 14, 2018 4:09 am Yep - limited success with my limited python knowledge - I can display all unsigned kernels (including the 4.15 ones) or none at all. It doesn't look pretty.... :roll: I might come back to this if I decide I need a challenge and the issue hasn't been properly patched already. it wasn't on my to do list.... :)
That's simple to fix though, in checkKernels.py just skip all unsigned ones that are not flagged as installed, should cover all use cases.
User avatar
Pjotr
Level 23
Level 23
Posts: 19887
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: Update Manager not showing 2.17 kernel in list of kernels

Post by Pjotr »

Why do you want to run an unsupported kernel in the first place? :shock:

Furthermore, UKUU kernels are only meant for testing and aren't fit for normal use:
https://sites.google.com/site/easylinux ... e-Utility-
(item 6.3.2, right column)

Finally: it's 4.17, not 2.17. You might want to fix your topic title and first message.
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
User avatar
Moem
Level 22
Level 22
Posts: 16226
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: Update Manager not showing 2.17 kernel in list of kernels

Post by Moem »

Pjotr wrote: Sat Jul 14, 2018 5:30 am Finally: it's 4.17, not 2.17. You might want to fix your topic title and first message.
That explains a lot... Silly me, for always assuming that people mean to write what they end up writing. :?
Image

If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!
gm10

Re: Update Manager not showing 2.17 kernel in list of kernels

Post by gm10 »

smurphos wrote: Sat Jul 14, 2018 4:09 am Yep - limited success with my limited python knowledge - I can display all unsigned kernels (including the 4.15 ones) or none at all. It doesn't look pretty.... :roll: I might come back to this if I decide I need a challenge and the issue hasn't been properly patched already. it wasn't on my to do list.... :)
Reviving this because I just had a moment to look into this, turned out to be simpler than I had initially thought:

This patch is for mintupdate/tara 5.4.0 and adds installed mainline kernels to the list. Obviously you can only remove them, not install them with this, this doesn't turn it into ukuu.

edit: patch removed since I put a more comprehensive version on github with a pull request to the mint repo
Last edited by gm10 on Fri Aug 17, 2018 3:41 pm, edited 2 times in total.
Resistor
Level 4
Level 4
Posts: 258
Joined: Wed Nov 03, 2010 12:04 am
Location: Western Ozarks

Re: Update Manager not showing 2.17 kernel in list of kernels

Post by Resistor »

gm10 wrote: Wed Aug 15, 2018 4:06 pm
smurphos wrote: Sat Jul 14, 2018 4:09 am Yep - limited success with my limited python knowledge - I can display all unsigned kernels (including the 4.15 ones) or none at all. It doesn't look pretty.... :roll: I might come back to this if I decide I need a challenge and the issue hasn't been properly patched already. it wasn't on my to do list.... :)
Reviving this because I just had a moment to look into this, turned out to be simpler than I had initially thought, only needed a small patch to one file:

Code: Select all

--- /usr/lib/linuxmint/mintUpdate/checkKernels.py
+++ checkKernels.py
@@ -15,14 +15,17 @@
     if settings.get_boolean("use-lowlatency-kernels"):
         kernel_type = "-lowlatency"
     cache = apt.Cache()
+    signed_kernels = ['']
     for pkg in cache:
         installed = 0
         used = 0
         installable = 0
         pkg_version = ""
         package = pkg.name
-        if (package.startswith("linux-image-3") or package.startswith("linux-image-4")) and package.endswith(kernel_type):
-            version = package.replace("linux-image-", "").replace("-generic", "").replace("-lowlatency", "")
+        if (package.startswith("linux-image-3") or package.startswith("linux-image-4") or package.startswith("linux-image-unsigned-3") or package.startswith("linux-image-unsigned-4")) and package.endswith(kernel_type):
+            version = package.replace("linux-image-unsigned-", "").replace("linux-image-", "").replace("-generic", "").replace("-lowlatency", "")
+            if version in signed_kernels:
+                continue
             if pkg.is_installed:
                 installed = 1
                 pkg_version = pkg.installed.version
@@ -43,6 +46,9 @@
                     element = "0%s" % element
                 versions.append(element)
 
+            if 'unsigned' not in pkg.name: # probably don't need this check, they should be sorted alphabetically
+                signed_kernels.append(version)
+
             resultString = "KERNEL###%s###%s###%s###%s###%s###%s" % (".".join(versions), version, pkg_version, installed, used, installable)
             print(resultString.encode("utf-8").decode('ascii', 'xmlcharrefreplace'))
 
This patch is for mintupdate/tara 5.4.0 and adds installed mainline kernels to the list. Obviously you can only remove them, not install them with this, this doesn't turn it into ukuu.

mintUpdate-kernels.png

One more thing to check off the list. ;)

PS: I probably better clarify for the uninitiated: patches like the one I posted can be applied with patch, don't just copy & paste it into a terminal.
Would it be practical to paste that content directly to:
/usr/lib/linuxmint/mintUpdate/checkKernels.py .?

Assuming with elevated privileges....
Dell Inspiron 15-7567 Gaming Laptop i5, 8GB Ram, 256GB SSD. - Win 10 Inhibited. Nvidia GTX 1050 Ti. LM 19.3 Cinnamon x2
Asus VivoBook F512FA-AB34, 8 GB Ram, Kernel 5.3.0-45-generic, i3-8145U. No Win10.
gm10

Re: Update Manager not showing 2.17 kernel in list of kernels

Post by gm10 »

Resistor wrote: Wed Aug 15, 2018 5:16 pm Would it be practical to paste that content directly to:
/usr/lib/linuxmint/mintUpdate/checkKernels.py .?

Assuming with elevated privileges....
Very much not so, no.

edit: Instructions added to post above
Last edited by gm10 on Thu Aug 16, 2018 4:48 am, edited 2 times in total.
Resistor
Level 4
Level 4
Posts: 258
Joined: Wed Nov 03, 2010 12:04 am
Location: Western Ozarks

Re: Update Manager not showing 4.17 kernel in list of kernels

Post by Resistor »

I'm glad I asked, since I'm among the uninitiated.

Thank you, gm10.
Dell Inspiron 15-7567 Gaming Laptop i5, 8GB Ram, 256GB SSD. - Win 10 Inhibited. Nvidia GTX 1050 Ti. LM 19.3 Cinnamon x2
Asus VivoBook F512FA-AB34, 8 GB Ram, Kernel 5.3.0-45-generic, i3-8145U. No Win10.
gm10

Re: Update Manager not showing 4.17 kernel in list of kernels

Post by gm10 »

edit: removed, see below
Last edited by gm10 on Fri Aug 17, 2018 4:14 pm, edited 1 time in total.
User avatar
smurphos
Level 18
Level 18
Posts: 8501
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: Update Manager not showing 4.17 kernel in list of kernels

Post by smurphos »

gm10 wrote: Thu Aug 16, 2018 4:51 am Then just apply the updated patch, I added instructions to the post this time.
Any intention to submit your patch as a Pull Request?
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
gm10

Re: Update Manager not showing 4.17 kernel in list of kernels

Post by gm10 »

smurphos wrote: Fri Aug 17, 2018 1:54 am
gm10 wrote: Thu Aug 16, 2018 4:51 am Then just apply the updated patch, I added instructions to the post this time.
Any intention to submit your patch as a Pull Request?
Maybe. It's just a quick hack. I'm not sure I'd call it release quality yet. I guess I'd have to at least detect locally installed kernels and not display the 3 links to ubuntu below them. Might do that eventually. edit: Nvm, did: https://github.com/linuxmint/mintupdate/pull/383 - as you can see that involved a few more changes... Anyway, up to the Mint devs now.
um-kernels2.png
Locked

Return to “Software & Applications”