Getting information about latest kernels status

In memory of this thread https://forum.manjaro.org/t/bash-find-most-recent-lts-version/52174 I wrote this Perl script to scrape the status from the last few kernels from kernel.org.

Name: kernel-versions.pl

#!/usr/bin/perl
use strict;
use warnings;
use LWP::Simple;

my $kernels_xml = get('https://www.kernel.org/feeds/kdist.xml') or die 'Unable to get page';

# Version:</th><td><strong>6.8.7</strong> (stable)
my $rx = qr/Version: .*? strong> ([^&]+) .*? \(([^)]+)\) /x;

while ($kernels_xml =~ /$rx/g) {
  print "$1 ($2)\n";
}

Does these not give more relevant information for Manjaro?

  • sudo mhwd-kernel -l, --list
  • sudo mhwd-kernel -li, --listinstalled

No, the crucial informations for me are (stable), (longterm), etc. and those are missing from the mhwd-kernel command.

I see. There’s always the Manjaro Settings Manager (GUI) but I suppose it’s nice to have a script for the job. Cheers.

1 Like

A bit more simple:

curl -s https://www.kernel.org/feeds/kdist.xml | xmllint --xpath '//rss/channel/item/title/text()' - 

No regex needed here…

2 Likes

Works like a charm, thanks.