Skip to content

Instantly share code, notes, and snippets.

@neuni
Last active August 29, 2015 14:19
Show Gist options
  • Select an option

  • Save neuni/c8e32b58f2d231feb3ea to your computer and use it in GitHub Desktop.

Select an option

Save neuni/c8e32b58f2d231feb3ea to your computer and use it in GitHub Desktop.

Revisions

  1. neuni renamed this gist Apr 13, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. neuni revised this gist Apr 13, 2015. 1 changed file with 11 additions and 3 deletions.
    14 changes: 11 additions & 3 deletions clean
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,18 @@
    First check `uname -a` to check your current version.
    First check your current version.

    ```
    uname -a
    ```

    Then run the following command:

    `dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d'`
    ```
    dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d'
    ```

    This command will list all packages that you no longer need.
    So for every package listed do the following:

    `sudo apt-get -y purge some-kernel-package`
    ```
    sudo apt-get -y purge some-kernel-package
    ```
  3. neuni created this gist Apr 13, 2015.
    10 changes: 10 additions & 0 deletions clean
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    First check `uname -a` to check your current version.

    Then run the following command:

    `dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d'`

    This command will list all packages that you no longer need.
    So for every package listed do the following:

    `sudo apt-get -y purge some-kernel-package`