Skip to main content
edited tags
Link
Gilles 'SO- stop being evil'
  • 865.9k
  • 205
  • 1.8k
  • 2.3k

Select Remove all kernel packages (kernels) except the currently usingused one

How can I select Select all packages (kernels) except the one I'm currently using? one

How can I automatically delete all other kernels which I'm not using?

So, here's my situation:

  • Using different versions of Ubuntu / CentOS
  • Automatic updates were on -> Linux downloaded many new kernel versions
  • Now I want to delete all other kernel versions, except the one I'm currently using

Code: #find out current kernel version: uname -r

#check which versions are downloaded to computer dpkg --get-selections | grep linux-image

#delete desired kernel sudo apt-get purge [KERNEL]

#autoremove sudo apt-get autoremove

#find out current kernel version: uname -r #check which versions are downloaded to computer dpkg --get-selections | grep linux-image #delete desired kernel sudo apt-get purge [KERNEL] #autoremove sudo apt-get autoremove 

There can be easily more than 15 kernels in one linux, and I have more than 50 linuxes which I have to go through.

So my question is, how can I automatically delete all other kernels which I'm not using?

How can I select all packages (kernels) except the one I'm currently using?

So, here's my situation:

  • Using different versions of Ubuntu / CentOS
  • Automatic updates were on -> Linux downloaded many new kernel versions
  • Now I want to delete all other kernel versions, except the one I'm currently using

Code: #find out current kernel version: uname -r

#check which versions are downloaded to computer dpkg --get-selections | grep linux-image

#delete desired kernel sudo apt-get purge [KERNEL]

#autoremove sudo apt-get autoremove

There can be easily more than 15 kernels in one linux, and I have more than 50 linuxes which I have to go through.

So my question is, how can I automatically delete all other kernels which I'm not using?

Select all packages (kernels) except the currently using one

How can I automatically delete all other kernels which I'm not using?

So, here's my situation:

  • Using different versions of Ubuntu / CentOS
  • Automatic updates were on -> Linux downloaded many new kernel versions
  • Now I want to delete all other kernel versions, except the one I'm currently using

Code:

#find out current kernel version: uname -r #check which versions are downloaded to computer dpkg --get-selections | grep linux-image #delete desired kernel sudo apt-get purge [KERNEL] #autoremove sudo apt-get autoremove 

There can be easily more than 15 kernels in one linux, and I have more than 50 linuxes which I have to go through.

edited body
Source Link
schaiba
  • 7.8k
  • 1
  • 35
  • 32
Loading
Source Link
NoobPenguin
  • 41
  • 1
  • 1
  • 3
Loading