Update Manager not showing 4.17 kernel in list of kernels

Questions about applications and software
Forum rules
Before you post please read how to get help
Nick Payne
Level 3
Level 3
Posts: 101
Joined: Sun Feb 21, 2010 8:49 pm

Update Manager not showing 4.17 kernel in list of kernels

Post by Nick Payne » Fri Jul 13, 2018 11:45 pm

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 Nick Payne on Mon Jul 16, 2018 3:38 am, edited 1 time in total.

User avatar
smurphos
Level 8
Level 8
Posts: 2040
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

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

Post by smurphos » Sat Jul 14, 2018 12:22 am

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

User avatar
trytip
Level 8
Level 8
Posts: 2415
Joined: Tue Jul 05, 2016 1:20 pm

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

Post by trytip » Sat Jul 14, 2018 2:16 am

it will only show up if you use ukuu
Image

User avatar
smurphos
Level 8
Level 8
Posts: 2040
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

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

Post by smurphos » 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.

User avatar
trytip
Level 8
Level 8
Posts: 2415
Joined: Tue Jul 05, 2016 1:20 pm

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

Post by trytip » Sat Jul 14, 2018 2:33 am

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 8
Level 8
Posts: 2040
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

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

Post by smurphos » Sat Jul 14, 2018 3:08 am

Does ukuu handle mainline kernel removal as well?

gm10
Level 12
Level 12
Posts: 4159
Joined: Thu Jun 21, 2018 5:11 pm

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

Post by gm10 » Sat Jul 14, 2018 3:30 am

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 8
Level 8
Posts: 2040
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

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

Post by smurphos » 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.

gm10
Level 12
Level 12
Posts: 4159
Joined: Thu Jun 21, 2018 5:11 pm

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

Post by gm10 » Sat Jul 14, 2018 3:39 am

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 8
Level 8
Posts: 2040
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

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

Post by smurphos » 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.... :)

gm10
Level 12
Level 12
Posts: 4159
Joined: Thu Jun 21, 2018 5:11 pm

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

Post by gm10 » Sat Jul 14, 2018 4:57 am

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 20
Level 20
Posts: 10985
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 » Sat Jul 14, 2018 5:30 am

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 19 Tara
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 17
Level 17
Posts: 7035
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 » Sat Jul 14, 2018 5:58 am

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
Level 12
Level 12
Posts: 4159
Joined: Thu Jun 21, 2018 5:11 pm

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

Post by gm10 » 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:

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
Attachments
mintUpdate-kernels.png
Last edited by gm10 on Fri Aug 17, 2018 3:41 pm, edited 2 times in total.

Resistor
Level 3
Level 3
Posts: 163
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 » Wed Aug 15, 2018 5:16 pm

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....
LM 17.3 Qiana v2, Cinnamon. Windows 8 is gone.
Dell Inspiron Ultrabook, 15z 5523, 6 GB RAM, Intel i3-3217U,
Intel 7 Series/C210 Audio. snd_hda_intel bus-ID: 00:1b.0...

gm10
Level 12
Level 12
Posts: 4159
Joined: Thu Jun 21, 2018 5:11 pm

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

Post by gm10 » Wed Aug 15, 2018 5:43 pm

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 3
Level 3
Posts: 163
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 » Wed Aug 15, 2018 5:51 pm

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

Thank you, gm10.
LM 17.3 Qiana v2, Cinnamon. Windows 8 is gone.
Dell Inspiron Ultrabook, 15z 5523, 6 GB RAM, Intel i3-3217U,
Intel 7 Series/C210 Audio. snd_hda_intel bus-ID: 00:1b.0...

gm10
Level 12
Level 12
Posts: 4159
Joined: Thu Jun 21, 2018 5:11 pm

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

Post by gm10 » Thu Aug 16, 2018 4:51 am

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 8
Level 8
Posts: 2040
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

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

Post by smurphos » 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?

gm10
Level 12
Level 12
Posts: 4159
Joined: Thu Jun 21, 2018 5:11 pm

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

Post by gm10 » Fri Aug 17, 2018 3:18 am

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

Post Reply

Return to “Software & Applications”