[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Getting versioned kernel packages



List generated by
apt-config dump --no-empty --format '%v%n' 'APT::VersionedKernelPackages'
gives lines

linux-image
linux-headers
linux-image-extra
linux-signed-image
kfreebsd-image
kfreebsd-headers
gnumach-image
.*-modules
.*-kernel
linux-backports-modules-.*
linux-tools
 
(in Ubuntu 14.04).

However not all .*-module or .*-kernel are related to kernels:
apt-cache search --names-only '.*' |cut -d' ' -f1| grep '.*-modules'
apt-cache search --names-only '.*' |cut -d' ' -f1| grep '.*-kernel'

How to match just versioned kernel packages?

I think of following kind of matching:

apt-cache search --names-only '.*'| awk '{print $1}' | grep -F -f <(apt-config dump --no-empty --format '%v%n' 'APT::VersionedKernelPackages')| grep [0-9] | sort

apt-cache search --names-only '.*'| awk '{print $1}' | awk '/^linux-.+-[0-9.]+-[^-]+/' | sort

In Ubuntu 14.05 the latter finds some packages than what the formed does not such as

linux-cloud-tools-3.13.0-57
linux-goldfish-headers-3.4.0-3
linux-lts-xenial-tools-4.4.0-21

There seems not to be *-kernel-.*[0-9].* packages in Ubuntu repositories, but if there were, the latter might not find them. Are the .*-modules and .*-kernel for linux kernels, too or just for the other operating systems (kfreedsb and gnumach) except for linux-backports-modules-.*?

-- 
Jarno Suni - http://iki.fi/8/ 

Reply to: