menuimage

Description

Usage

Examples

Options

License

Changelog

Download

Donation

My_Other_Sites

My_Programs

Comments

kernel-remove v1.7 [27 Aug 2024] by Dominic

Description

Command line program to shows installed Linux kernels in a Debian-based distro. It can remove superfluous ones, including related packages, updating grub or grub2 appropriately. Does not require a GUI. You are prompted before any dangerous stuff happens, and it will not allow removal of the kernel that is currently in use, but should still be used with care: once a kernel is gone, it's gone!

Tested under Ubuntu 10.04 to 22.04. May not work under Lubuntu (because kernel packages are differently named).

Usage

kernel-remove.sh [options] kernelnumbertoremove-filter

Examples

./kernel-remove.sh # list kernel packages and exit
./kernel-remove.sh 2.6.32-24 # remove 2.6.32-24 kernel
./kernel-remove.sh 2.6.32 # remove all 2.6.32-* kernels

Options

-h show this help and exit
-l show changelog and exit
-o remove all kernels older than the active kernel

License

Copyright © 2024 Dominic Raferd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Changelog

1.7 [27 Aug 2024] - allow removal of specified subdirectories of /lib/modules - which can be left behind after matching kernels are removed by apt
1.6 [17 Nov 2022] - conform (where appropriate) with shellcheck
1.5 [23 Mar 2022] - also remove any leftover directory/ies in /lib/modules
1.4 [12 May 2015] - allow deletion of any kernel series
1.3 [11 Dec 2014] - add -o option (new different code)

Download kernel-remove.sh

Donation

I have provided this software free gratis and for nothing. If you would like to thank me with a contribution, please let me know and I will send you a link. Thank you!

My Other Sites

My Programs

Here is a selection of some (other) programs I have written, most of which run under GNU/Linux from the command line (CLI), are freely available and can be obtained by clicking on the links. Dependencies are shown and while in most cases written and tested on an x86-based Linux server, they should run on a Raspberry Pi, and many can run under Windows using Windows Subsystem for Linux (WSL) or Cygwin. Email me if you have problems or questions, or if you think I could help with a programming requirement.

Backup Utilities

Debian/Ubuntu kernel and LVM Utilities

Miscellaneous Programs

Comments

This section is closed. If you have a question, please submit it by email, thank you.

No comments yet for '/programs/help/kernel-remove.sh.php'