jordanhillis / pvekclean Goto Github PK
View Code? Open in Web Editor NEWEasily remove old/unused PVE kernels on your Proxmox VE system
License: MIT License
Easily remove old/unused PVE kernels on your Proxmox VE system
License: MIT License
This utility doesn't account for the boot method used; it seems to focus on GRUB installations, and disregards UEFI systemd-boot installations which require the use of proxmox-boot-tool refresh
to update the kernel boot list.
Hi Jordan,
just to let you know that the script also works on Proxmox Backup Server (PBS).
First time it found 9 old kernels, I deleted them and rebooted.
Ran the script again and found another one that wasn't in the previous list, and deleted it. That was the only strange thing.
Rebooted again, ran it again, and no old kernels. :)
Consider adding an ability to switch kernels.
it would be amazing if the module had an option to allow it to keep back a certain number of kernels
currently it removes all old kernela excluding the latest you have installed OR the latest one if you havent restarted yet to apply it
an option like maybe --keep 3
to say keep the 3 latest kernels
The installation instructions call for using git, and the update instructions say to repeat install, but with git that is really not repeat, it would be a git pull, which is not quite the same.
Suggest as alternative instructions to execute script directly using e.g.
wget -O - https://raw.githubusercontent.com/jordanhillis/pvekclean/master/pvekclean.sh | bash -s arg1 arg2
With root zfs the free space is not shown.
Leaves behind redundant meta packages, such as pve-kernel-5.11
update log:
proxmox-kernel-6.2 (6.2.16-7) bookworm; urgency=medium
change pve-
prefix to proxmox-
merge proxmox-kernel-meta packaging into main kernel repository
bump ABI to 6.2.16-6
Have run with the -rn
option and it returns the following (only highlighting older version for deletion). System is running 6.5.11-8-pve and uname -r
shows 6.5.11-8-pve
. Am I missing something
___________________________________________
OS: Debian GNU/Linux 12 (bookworm)
Boot Disk: 2% full [12M/1022M used, 1011M free]
Current Kernel: 6.5.11-8-pve
Latest Kernel: 6.5.13-1-pve-signed
___________________________________________
[*] Boot disk space used is Healthy at 2% capacity (1011M free)
[-] Searching for old PVE kernels on your system...
+ "6.5" added to the kernel remove list
+ "6.5.11-4-pve-signed" added to the kernel remove list
+ "6.5.11-6-pve-signed" added to the kernel remove list
+ "6.5.11-7-pve-signed" added to the kernel remove list
[-] PVE kernel search complete!
[!] Would you like to remove the 4 selected PVE kernels listed above? [y/N]: n
Not sure if this is info, or warning, or error?
./pvekclean.sh: line 447: ((: 08: value too great for base (error token is "08")
./pvekclean.sh: line 448: ((: 08: value too great for base (error token is "08")
./pvekclean.sh: line 449: ((: 08: value too great for base (error token is "08")
pieter@server-1:~$ sudo ./pvekclean.sh
█▀▀█ ▀█ █▀ █▀▀ █ █ █▀▀ █▀▀█ █▀▀▄ █▀▀ █
█ █ █▄█ █▀▀ █▀▄ █▀▀ █▄▄▀ █ █ █▀▀ █
█▀▀▀ ▀ ▀▀▀ ▀ ▀ ▀▀▀ ▀ ▀▀ ▀ ▀ ▀▀▀ ▀▀▀
█▀▀ █ █▀▀ █▀▀█ █▀▀▄ █▀▀ █▀▀█
█ █ █▀▀ █▄▄█ █ █ █▀▀ █▄▄▀ ⎦˚◡˚⎣ v2.0
▀▀▀ ▀▀▀ ▀▀▀ ▀ ▀ ▀ ▀ ▀▀▀ ▀ ▀▀
By Jordan Hillis [[email protected]]
___________________________________________
Usage: pvekclean.sh [OPTION1] [OPTION2]...
-k, --keep [number] Keep the specified number of most recent PVE kernels on the system
Can be used with -f or --force for non-interactive removal
-f, --force Force the removal of old PVE kernels without confirm prompts
-rn, --remove-newer Remove kernels that are newer than the currently running kernel
-s, --scheduler Have old PVE kernels removed on a scheduled basis
-v, --version Shows current version of pvekclean
-r, --remove Uninstall pvekclean from the system
-d, --debug Run the program in debug mode for testing without making system changes
___________________________________________
OS: Debian GNU/Linux 12 (bookworm)
Boot Disk: 1% full [312K/511M used, 511M free]
Current Kernel: 6.2.16-18-pve
___________________________________________
[-] Can we install PVE Kernel Cleaner to your /usr/local/sbin for easier access [y/N] n
[*] Boot disk space used is healthy at 1% capacity (511M free)
[-] Searching for old PVE kernels on your system...
+ "5.4.34-1-pve" added to the kernel remove list
+ "5.4.41-1-pve" added to the kernel remove list
+ "5.4.44-1-pve" added to the kernel remove list
+ "5.4.44-2-pve" added to the kernel remove list
+ "5.4.55-1-pve" added to the kernel remove list
+ "5.4.60-1-pve" added to the kernel remove list
+ "5.4.65-1-pve" added to the kernel remove list
+ "5.4.73-1-pve" added to the kernel remove list
+ "5.4.78-2-pve" added to the kernel remove list
+ "5.4.106-1-pve" added to the kernel remove list
+ "5.4.114-1-pve" added to the kernel remove list
+ "5.4.119-1-pve" added to the kernel remove list
+ "5.4.124-1-pve" added to the kernel remove list
+ "5.4.128-1-pve" added to the kernel remove list
+ "5.11.22-3-pve" added to the kernel remove list
+ "5.11.22-4-pve" added to the kernel remove list
+ "5.11.22-5-pve" added to the kernel remove list
+ "5.11.22-7-pve" added to the kernel remove list
+ "5.13.19-1-pve" added to the kernel remove list
+ "5.13.19-2-pve" added to the kernel remove list
+ "5.13.19-3-pve" added to the kernel remove list
+ "5.13.19-6-pve" added to the kernel remove list
+ "5.15.30-2-pve" added to the kernel remove list
+ "5.15.35-1-pve" added to the kernel remove list
+ "5.15.35-2-pve" added to the kernel remove list
+ "5.15.39-1-pve" added to the kernel remove list
+ "5.15.39-4-pve" added to the kernel remove list
+ "5.15.53-1-pve" added to the kernel remove list
+ "5.15.60-1-pve" added to the kernel remove list
+ "5.15.60-2-pve" added to the kernel remove list
+ "5.15.64-1-pve" added to the kernel remove list
+ "5.15.74-1-pve" added to the kernel remove list
+ "5.15.83-1-pve" added to the kernel remove list
+ "5.15.85-1-pve" added to the kernel remove list
+ "5.15.102-1-pve" added to the kernel remove list
+ "5.15.104-1-pve" added to the kernel remove list
+ "5.15.107-2-pve" added to the kernel remove list
+ "5.15.108-1-pve" added to the kernel remove list
+ "6.2.16-5-pve" added to the kernel remove list
+ "6.2.16-6-pve" added to the kernel remove list
+ "6.2.16-8-pve" added to the kernel remove list
+ "6.2.16-10-pve" added to the kernel remove list
+ "6.2.16-12-pve" added to the kernel remove list
+ "6.2.16-15-pve" added to the kernel remove list
[-] PVE kernel search complete!
[!] Would you like to remove the 44 selected PVE kernels listed above? [y/N]: y
[*] Removing 44 old PVE kernels...
[-] Removing kernel: 5.4.34-1-pve...DONE!
[-] Removing kernel: 5.4.41-1-pve...DONE!
[-] Removing kernel: 5.4.44-1-pve...DONE!
[-] Removing kernel: 5.4.44-2-pve...DONE!
[-] Removing kernel: 5.4.55-1-pve...DONE!
[-] Removing kernel: 5.4.60-1-pve...DONE!
[-] Removing kernel: 5.4.65-1-pve...DONE!
[-] Removing kernel: 5.4.73-1-pve...DONE!
[-] Removing kernel: 5.4.78-2-pve...DONE!
[-] Removing kernel: 5.4.106-1-pve...DONE!
[-] Removing kernel: 5.4.114-1-pve...DONE!
[-] Removing kernel: 5.4.119-1-pve...DONE!
[-] Removing kernel: 5.4.124-1-pve...DONE!
[-] Removing kernel: 5.4.128-1-pve...DONE!
[-] Removing kernel: 5.11.22-3-pve...DONE!
[-] Removing kernel: 5.11.22-4-pve...DONE!
[-] Removing kernel: 5.11.22-5-pve...DONE!
[-] Removing kernel: 5.11.22-7-pve...DONE!
[-] Removing kernel: 5.13.19-1-pve...DONE!
[-] Removing kernel: 5.13.19-2-pve...DONE!
[-] Removing kernel: 5.13.19-3-pve...DONE!
[-] Removing kernel: 5.13.19-6-pve...DONE!
[-] Removing kernel: 5.15.30-2-pve...DONE!
[-] Removing kernel: 5.15.35-1-pve...DONE!
[-] Removing kernel: 5.15.35-2-pve...DONE!
[-] Removing kernel: 5.15.39-1-pve...DONE!
[-] Removing kernel: 5.15.39-4-pve...DONE!
[-] Removing kernel: 5.15.53-1-pve...DONE!
[-] Removing kernel: 5.15.60-1-pve...DONE!
[-] Removing kernel: 5.15.60-2-pve...DONE!
[-] Removing kernel: 5.15.64-1-pve...DONE!
[-] Removing kernel: 5.15.74-1-pve...DONE!
[-] Removing kernel: 5.15.83-1-pve...DONE!
[-] Removing kernel: 5.15.85-1-pve...DONE!
[-] Removing kernel: 5.15.102-1-pve...DONE!
[-] Removing kernel: 5.15.104-1-pve...DONE!
[-] Removing kernel: 5.15.107-2-pve...DONE!
[-] Removing kernel: 5.15.108-1-pve...DONE!
[-] Removing kernel: 6.2.16-5-pve...DONE!
[-] Removing kernel: 6.2.16-6-pve...DONE!
[-] Removing kernel: 6.2.16-8-pve...DONE!
[-] Removing kernel: 6.2.16-10-pve...DONE!
[-] Removing kernel: 6.2.16-12-pve...DONE!
[-] Removing kernel: 6.2.16-15-pve...DONE!
[*] Updating GRUB...DONE!
./pvekclean.sh: line 447: ((: 08: value too great for base (error token is "08")
./pvekclean.sh: line 448: ((: 08: value too great for base (error token is "08")
./pvekclean.sh: line 449: ((: 08: value too great for base (error token is "08")
[-] Have a nice night ⎦˚◡˚⎣
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.