kittykernel - a little GUI for managing kernels

About programming and getting involved with Linux Mint development
Post Reply
Schallaven
Level 2
Level 2
Posts: 90
Joined: Sun Jul 16, 2017 11:42 am

kittykernel - a little GUI for managing kernels

Post by Schallaven »

Hello!

I wrote myself a little tool for managing kernels on Mint (and another Ubuntu machine actually) and thought maybe someone else might also find it handy. Thus, I am sharing :) Find the tool at: https://github.com/Schallaven/kittykernel

Features:
  • Manages kernels with a handy GUI
  • Can install all kernels available in repos (e.g. low-latency)
  • Can remove and/or purge multiple kernels to clean up /boot (this was actually the driving point for writing this)
  • If available: scrolls to the currently selected kernel in the changelog
  • Convinces users by using an alliteration for its name
At the moment it uses synaptic for installing packages (it provides a handy interface to have progress-dialogs, etc), but that might change in future.

Impression:
kittykernelimpression.png
kittykernel - a cat-friendly, custom kernel manager for Linux Mint and other Debian derivates. Take a look or two here: Releases Github
Your argument is irrelephant - it's lacking elephants.
User avatar
Pjotr
Level 22
Level 22
Posts: 16551
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: kittykernel - a little GUI for managing kernels

Post by Pjotr »

Sounds cool! :)

When it comes to removing old kernels, in what respects does it differ from purge-old-kernels?

Code: Select all

#!/bin/sh
#
#    purge-old-kernels - remove old kernel packages
#    Copyright (C) 2012 Dustin Kirkland <kirkland@ubuntu.com>
#
#    Authors: Dustin Kirkland <kirkland@ubuntu.com>
#             Kees Cook <kees@ubuntu.com>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, version 3 of the License.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

# Ensure we're running as root
if [ "$(id -u)" != 0 ]; then
	echo "ERROR: This script must run as root.  Hint..." 1>&2
	echo "  sudo $0 $@" 1>&2
	exit 1
fi

# NOTE: This script will ALWAYS keep the currently running kernel
# NOTE: Default is to keep 2 more, user overrides with --keep N
KEEP=2
# NOTE: Any unrecognized option will be passed straight through to apt
APT_OPTS=
while [ ! -z "$1" ]; do
	case "$1" in
		--keep)
			# User specified the number of kernels to keep
			KEEP="$2"
			shift 2
		;;
		*)
			APT_OPTS="$APT_OPTS $1"
			shift 1
		;;
	esac
done

# Build our list of kernel packages to purge
CANDIDATES=$(ls -tr /boot/vmlinuz-* | head -n -${KEEP} | grep -v "$(uname -r)$" | cut -d- -f2- | awk '{print "linux-image-" $0 " linux-headers-" $0}' )
for c in $CANDIDATES; do
	dpkg-query -s "$c" >/dev/null 2>&1 && PURGE="$PURGE $c"
done

if [ -z "$PURGE" ]; then
	echo "No kernels are eligible for removal"
	exit 0
fi

apt $APT_OPTS remove --purge $PURGE
Tip: 10 things to do after installing Linux Mint 20.1 Ulyssa
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Schallaven
Level 2
Level 2
Posts: 90
Joined: Sun Jul 16, 2017 11:42 am

Re: kittykernel - a little GUI for managing kernels

Post by Schallaven »

For me, I moved from 4.4 through 4.8 to 4.10 now, and might in future go to 4.11 (actually waiting for 4.12). I wanted to keep always the last generation/line of kernels, prior to my current one. So, if I want just to purge 4.4-line, I can do that by right clicking on 4.4, choose the respective option, and done. As far as I can see, the script does not do this.

In future, I want to add some handy features like "hiding this line", so I don't see anything from 4.4 anymore, for example. Small, handy things (or look for example that it shows the /boot size and the current kernel above the list, etc.)

But in the end, you can always ask such things as "Why do people use software manager instead of apt-get install?" or similar. Because people differ in taste and requirements. Same here, I think :)
kittykernel - a cat-friendly, custom kernel manager for Linux Mint and other Debian derivates. Take a look or two here: Releases Github
Your argument is irrelephant - it's lacking elephants.
User avatar
mrmajik45
Level 5
Level 5
Posts: 597
Joined: Tue Aug 29, 2017 9:51 pm
Location: USA, indiana
Contact:

Re: kittykernel - a little GUI for managing kernels

Post by mrmajik45 »

Cool Program! If you learn a bit more about linux you might be able to use something as than synaptic for the installer
:D :D :D
ReactOS Donator ~ $5.00 | Linux Mint Donator ~ $1.00 in BTC
User avatar
zshlover
Level 1
Level 1
Posts: 31
Joined: Sun Jul 05, 2020 8:34 am

Re: kittykernel - a little GUI for managing kernels

Post by zshlover »

Wow this is pretty neat! I remember Manjaro had something like this, but I'm not to big of a fan of the rolling release model
Learn Python: pythonspot.com, pyqt
User avatar
Pjotr
Level 22
Level 22
Posts: 16551
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: kittykernel - a little GUI for managing kernels

Post by Pjotr »

zshlover wrote:
Sun Jul 05, 2020 9:08 am
Wow this is pretty neat! I remember Manjaro had something like this, but I'm not to big of a fan of the rolling release model
Why are you drawing attention to software that hasn't been updated in years? Whereas the kernel tool in Mint's very own Update Manager does the same job nowadays?
Tip: 10 things to do after installing Linux Mint 20.1 Ulyssa
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Post Reply