I'm trying to get last version of installed kernel package.
The main difficulty is that in my case the versions may be installed in a wrong order, so I cannot simply use the --last
argument from rpm
.
I wanted to use the coreutils
' sort
command (coreutils-8.4-31.el6_5.1) which contains a --version-sort
argument, but this does not return as expected:
$ rpm -q 'kernel' |sort --version-sort
kernel-2.6.32-431.5.1.el6.x86_64
kernel-2.6.32-431.11.2.el6.x86_64
kernel-2.6.32-431.17.1.el6.x86_64
kernel-2.6.32-431.el6.x86_64
rpm -q 'kernel' --last
kernel-2.6.32-431.17.1.el6.x86_64 mar. 13 mai 2014 09:48:44 CEST
kernel-2.6.32-431.11.2.el6.x86_64 jeu. 24 avril 2014 11:15:25 CEST
kernel-2.6.32-431.5.1.el6.x86_64 mer. 12 mars 2014 15:52:23 CET
kernel-2.6.32-431.el6.x86_64 ven. 29 nov. 2013 17:48:19 CET
As you can see, the revision 431.e16 (the oldest) is sorted as the latest.
A call to rpm -qi
confirm that:
Release : 431.17.1.el6 Build Date: jeu. 08 mai 2014 02:48:49 CEST
Release : 431.el6 Build Date: ven. 22 nov. 2013 05:28:33 CET
Is this a known bug of sort
? Is it already patched? Is there a simple workaround or another way to get the latest installed version?