Skip to content

Instantly share code, notes, and snippets.

@yannvery
Last active May 19, 2022 09:44
Show Gist options
  • Save yannvery/93c007154901341867f8 to your computer and use it in GitHub Desktop.
Save yannvery/93c007154901341867f8 to your computer and use it in GitHub Desktop.
Ubuntu - Purge old kernels and unused modules

Ubuntu - Purge old kernels and unused modules

Purge old kernels

Open terminal and check your current kernel:

uname -r

DO NOT REMOVE THIS KERNEL!

Then, type the command below to list all installed kernels on your system.

dpkg --list | grep 3.16.

Find all the kernels that lower than your current kernel. When you know which kernel to remove, continue below to remove it. Run the commands below to remove the kernel you selected.

sudo apt-get purge 3.16.X-X-generic 

Remove temp installation files

Open a terminal.

Remove outdated packages from cache:

sudo apt-get autoclean

Remove every package from the cache:

sudo apt-get clean

Remove installed packages as dependencies which have been unused

sudo apt-get autoremove
@yannvery
Copy link
Author

@solbu thanks for the clarifications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment