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

Bug#918607: ITP: kthresher -- Purge Unused Kernels



Hi Eduard,

On 1/7/19 10:53 PM, Eduard Bloch wrote:> * Darshaka Pathirana [Mon, Jan 07 2019, 07:30:24PM]:
>> Package: wnpp
>> Severity: wishlist
>> Owner: Darshaka Pathirana <dpat@syn-net.org>
>>
>> * Package name    : kthresher
>>   Version         : 1.3.1
>>   Upstream Author : Rackspace US, Inc.
>> * URL             : https://github.com/rackerlabs/kthresher
>> * License         : Apache
>>   Programming Lang: Python
>>   Description     : Purge Unused Kernels
>>
>> Tool to remove unused kernels that were installed automatically
>> This tool removes those kernel packages marked as candidate for autoremoval.
>> Those packages are generally installed via Unattended upgrade or
>> meta-packages. By default the latest kernel and manual installations are
>> marked to Never Auto Remove.
>
> Please point out the difference to "deborphan --guess-kernel" somewhere
> along the lines.

I've forwarded your question to the upstream developer Tony Garcia
<tony.garcia@RACKSPACE.COM> and this is his answer:

,----
| Here the response with deborphan, first of all I acknowledge I was not aware of
| this package, but after poking a bit with it I wasn't able to find a way to do
| what kthresher does, few points:
|
| - kthresher is focused on kernel images and headers
| - deborphan is focused on libraries with extension to other type of packages,
|   there is one related to kernels but is only kernel modules:
|
|   # deborphan --help | grep kernel
|   --guess-kernel              Try to report kernel modules.
|
| Man pages explains that it tries to find kernel modules only, not kernel
| images:
|
|   --guess-kernel  This option tries to find kernel-modules. It tries to match (-modules|^nvidia-kernel)-.*[0-9]+\.[0-9]+\.[0-9]+.
|
|
| - kthresher will only remove packages listed as candidates for autoremoval,
|   will not remove: running kernel, latest kernel nor unexplicitly kernels
|   installed.
| - Did not find a way to remove kernels with deborphan.
| - kthresher is meant to be executed through a cronjob/timer to purge old
|   kernels on a nightly basis
|
| This is an example of both (kthresher and deborphan) being executed on a server with multiple kernels:
|
| # deborphan --guess-kernel
| libxapian30
| libxenstore3.0
|
|  ## Here kthresher is showing the available kernel packages for autoremoval:
|
| # python3 kthresher.py -s
| INFO: List of kernel packages available for autoremoval:
| INFO:            Version Package
| INFO:    4.9.30-2+deb9u5 linux-headers-4.9.0-3-all-amd64
| INFO:    4.9.30-2+deb9u5 linux-headers-4.9.0-3-amd64
| INFO:    4.9.30-2+deb9u5 linux-headers-4.9.0-3-common
| INFO:    4.9.30-2+deb9u5 linux-headers-4.9.0-3-common-rt
| INFO:    4.9.30-2+deb9u5 linux-headers-4.9.0-3-rt-amd64
| INFO:    4.9.65-3+deb9u1 linux-headers-4.9.0-4-all-amd64
| INFO:    4.9.65-3+deb9u1 linux-headers-4.9.0-4-amd64
| INFO:    4.9.65-3+deb9u1 linux-headers-4.9.0-4-common
| INFO:    4.9.65-3+deb9u1 linux-headers-4.9.0-4-common-rt
| INFO:    4.9.65-3+deb9u1 linux-headers-4.9.0-4-rt-amd64
| INFO:    4.9.65-3+deb9u2 linux-headers-4.9.0-5-all-amd64
| INFO:    4.9.65-3+deb9u2 linux-headers-4.9.0-5-amd64
| INFO:    4.9.65-3+deb9u2 linux-headers-4.9.0-5-common
| INFO:    4.9.65-3+deb9u2 linux-headers-4.9.0-5-common-rt
| INFO:    4.9.65-3+deb9u2 linux-headers-4.9.0-5-rt-amd64
| INFO:    4.9.88-1+deb9u1 linux-headers-4.9.0-6-all-amd64
| INFO:   4.9.110-3+deb9u2 linux-headers-4.9.0-7-all-amd64
| INFO:    4.9.30-2+deb9u5 linux-image-4.9.0-3-amd64
| INFO:    4.9.30-2+deb9u5 linux-image-4.9.0-3-rt-amd64
| INFO:    4.9.65-3+deb9u1 linux-image-4.9.0-4-amd64
| INFO:    4.9.65-3+deb9u1 linux-image-4.9.0-4-rt-amd64
| INFO:    4.9.65-3+deb9u2 linux-image-4.9.0-5-amd64
| INFO:    4.9.65-3+deb9u2 linux-image-4.9.0-5-rt-amd64
|
|   ## Here kthresher is attempting to remove all the candidates of headers and
|   ## images for autoremoval keeping 0 (dry-run)
|
| # python3 kthresher.py -v -d -H -k0
| INFO: Attempting to read /etc/kthresher.conf.
| INFO: Config file /etc/kthresher.conf is empty or does not exist, ignoring.
| INFO: Options: {'purge': False, 'headers': True, 'keep': 0, 'verbose': True, 'dry_run': True}
| INFO: ----- DRY RUN -----
| INFO: Running kernel is linux-image-4.9.0-7-amd64 v[4.9.110-1]
| INFO: Attempting to keep 0 kernel package(s)
| INFO: Found 5 kernel image(s) installed and available for autoremoval
| INFO: Pre-sorting: ['4.9.88-1+deb9u1', '4.9.65-3+deb9u1', '4.9.30-2+deb9u5', '4.9.65-3+deb9u2', '4.9.110-3+deb9u2']
| INFO: Post-sorting: ['4.9.30-2+deb9u5', '4.9.65-3+deb9u1', '4.9.65-3+deb9u2', '4.9.88-1+deb9u1', '4.9.110-3+deb9u2']
| INFO: 	Purging packages from version: 4.9.30-2+deb9u5
| INFO: 		Purging: linux-image-4.9.0-3-amd64
| INFO: 		Purging: linux-image-4.9.0-3-rt-amd64
| INFO: 		Purging: linux-headers-4.9.0-3-all-amd64
| INFO: 		Purging: linux-headers-4.9.0-3-amd64
| INFO: 		Purging: linux-headers-4.9.0-3-common
| INFO: 		Purging: linux-headers-4.9.0-3-common-rt
| INFO: 		Purging: linux-headers-4.9.0-3-rt-amd64
| INFO: 	Purging packages from version: 4.9.65-3+deb9u1
| INFO: 		Purging: linux-image-4.9.0-4-amd64
| INFO: 		Purging: linux-image-4.9.0-4-rt-amd64
| INFO: 		Purging: linux-headers-4.9.0-4-all-amd64
| INFO: 		Purging: linux-headers-4.9.0-4-amd64
| INFO: 		Purging: linux-headers-4.9.0-4-common
| INFO: 		Purging: linux-headers-4.9.0-4-common-rt
| INFO: 		Purging: linux-headers-4.9.0-4-rt-amd64
| INFO: 	Purging packages from version: 4.9.65-3+deb9u2
| INFO: 		Purging: linux-image-4.9.0-5-amd64
| INFO: 		Purging: linux-image-4.9.0-5-rt-amd64
| INFO: 		Purging: linux-headers-4.9.0-5-all-amd64
| INFO: 		Purging: linux-headers-4.9.0-5-amd64
| INFO: 		Purging: linux-headers-4.9.0-5-common
| INFO: 		Purging: linux-headers-4.9.0-5-common-rt
| INFO: 		Purging: linux-headers-4.9.0-5-rt-amd64
| INFO: 	Purging packages from version: 4.9.88-1+deb9u1
| INFO: 		Purging: linux-headers-4.9.0-6-all-amd64
| INFO: 	Purging packages from version: 4.9.110-3+deb9u2
| INFO: 		Purging: linux-headers-4.9.0-7-all-amd64
|
|
| I wasn't able to remove packages with deborphan but seems like the main task of
| this tool is to find packages that are might not bee needed but does not seem
| to have a way to remove packages through it, you will need to use another tool
| to then remove those packages.
|
`----

I hope his reply did answer you question.

Regards,
 - Darsha

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: