Skip to content

Instantly share code, notes, and snippets.

@WarpEngineer
Last active September 13, 2016 01:11
Show Gist options
  • Save WarpEngineer/2aa20dcdcab656461b05 to your computer and use it in GitHub Desktop.
Save WarpEngineer/2aa20dcdcab656461b05 to your computer and use it in GitHub Desktop.

Revisions

  1. WarpEngineer revised this gist Sep 13, 2016. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions Remove old kernels in Ubuntu
    Original file line number Diff line number Diff line change
    @@ -1 +1,8 @@
    List all installed Linux kernel images:
    dpkg --list | egrep -i --color 'linux-image|linux-headers'

    Remove a single image:
    apt-get --purge remove linux-image-...

    Remove all:
    apt-get purge $(dpkg --list |egrep 'linux-image-[0-9]' |awk '{print $3,$2}' |sort -nr |tail -n +3 |grep -v $(uname -r) |awk '{ print $2}')
  2. WarpEngineer revised this gist Dec 13, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Remove old kernels in Ubuntu
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    apt-get purge $(dpkg --list |egrep 'linux-image-[0-9]' |awk '{print $3,$2}' |sort -nr |tail -n +2 |grep -v $(uname -r) |awk '{ print $2}')
    apt-get purge $(dpkg --list |egrep 'linux-image-[0-9]' |awk '{print $3,$2}' |sort -nr |tail -n +3 |grep -v $(uname -r) |awk '{ print $2}')
  3. WarpEngineer created this gist Dec 13, 2014.
    1 change: 1 addition & 0 deletions Remove old kernels in Ubuntu
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    apt-get purge $(dpkg --list |egrep 'linux-image-[0-9]' |awk '{print $3,$2}' |sort -nr |tail -n +2 |grep -v $(uname -r) |awk '{ print $2}')