close
» » How to remove old unneeded kernels

How to remove old unneeded kernels

Other / System
How to remove old unneeded kernelsThe kernel of the system is periodically updated and is good. But the system eventually clogged the old kernels, and this is bad.
Previously, for these purposes I used the excellent utility KERNELS in the update manager of Linux Mint, I decided to find other solutions.
As always in Linux there are several solutions to the same problem.
In this small article I will show you how you can remove old kernels in Linux Mint in various ways.
Way 1.
You can remove the old core system with a single command in the Terminal. You need to do the following:
sudo apt purge $(dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | head -n -1)
and then run:
sudo apt autoremove && sudo update-grub
Way 2.
You can use the excellent Synaptic package manager. Run the program, click the Search button and enter query - linux-image
How to remove old unneeded kernelsNow we need to sort the list by the first column. To do this, click on the first column, thus first appeared on the list of installed packages that will be highlighted in green.
I recommend to keep the latest and previous version of the kernel, and all the rest can be safely deleted. To do this select the old versions of packages linux-image-X. X. x-generic, linux-headers-X. X. x, linux-headers-X. X. x-generic, clicking with the right mouse button and selecting “Mark for complete removal”, and then click Apply.
The system grub will be updated automatically.
How to remove old unneeded kernelsMay the Force be with you,
Good Luck!!!

Print version

Add comments

  • Local comments
  • Facebook comments
Triple Y
Triple Y 5 May 2017 20:35
It worked - the sudo command! :) Freed up over 3 GB of SSD space. Nice!
Thanks, man!
  • +1
Chlubister
Chlubister Today, 08:45
Otherwise there is Kclean.deb
  • 0
  • bowtiesmilelaughingblushsmileyrelaxedsmirk
    heart_eyeskissing_heartkissing_closed_eyesflushedrelievedsatisfiedgrin
    winkstuck_out_tongue_winking_eyestuck_out_tongue_closed_eyesgrinningkissingstuck_out_tonguesleeping
    worriedfrowninganguishedopen_mouthgrimacingconfusedhushed
    expressionlessunamusedsweat_smilesweatdisappointed_relievedwearypensive
    disappointedconfoundedfearfulcold_sweatperseverecrysob
    joyastonishedscreamtired_faceangryragetriumph
    sleepyyummasksunglassesdizzy_faceimpsmiling_imp
    neutral_faceno_mouthinnocent
Your working environment Other polls