Difference between revisions of "Clean ubuntu"

Line 28: Line 28:
 
dpkg --list 'linux-image*'
 
dpkg --list 'linux-image*'
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
  
 
You should see something like:
 
You should see something like:
Line 56: Line 57:
  
  
 +
===Delete kernels===
  
 +
Delete the kernels you don't want/need anymore
  
 +
<syntaxhighlight lang="bash">
 +
apt-get remove --purge linux-image-VERSION linux-image-extra-VERSION
 +
apt-get autoremove
 +
</syntaxhighlight>
  
 +
Replace VERSION with the version of the kernel you want to remove.
  
  
 
+
Example:
 
 
Delete the kernels you don't want/need anymore
 
  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
apt-get remove linux-image-VERSION
+
apt-get remove --purge linux-image-3.13.0-24-generic linux-image-extra-3.13.0-24-generic  linux-image-3.13.0-30-generic linux-image-extra-3.13.0-30-generic
 +
apt-get autoremove
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Replace VERSION with the version of the kernel you want to remove.
 
 
When you're done removing the older kernels, you can run this to remove ever packages you won't need anymore:
 
 
sudo apt-get autoremove
 
And finally you can run this to update grub kernel list:
 
  
sudo update-grub
+
===Update kernels list===
  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
sudo add-apt-repository ppa:caffeine-developers/ppa
+
update-grub
sudo apt-get update && sudo apt-get install caffeine
 
 
</syntaxhighlight>
 
</syntaxhighlight>

Revision as of 17:35, 20 August 2014


Clean /boot

Manual method

Kernel version

Get your current kernel version

uname -r


You should see something like:

3.13.0-32-generic


Installed kernels

Get a list of installed kernels

dpkg --list 'linux-image*'


You should see something like:

/ Name Version Architecture Description
un linux-image <none> <none> (no description available)
un linux-image-3.0 <none> <none> (no description available)
rc linux-image-3.13.0-24-generic 3.13.0-24.47 amd64 Linux kernel image for version 3.13.0 on 64 bit x86 SMP
ii linux-image-3.13.0-30-generic 3.13.0-30.55 amd64 Linux kernel image for version 3.13.0 on 64 bit x86 SMP
ii linux-image-3.13.0-32-generic 3.13.0-32.57 amd64 Linux kernel image for version 3.13.0 on 64 bit x86 SMP
rc linux-image-extra-3.13.0-24-generic 3.13.0-24.47 amd64 Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP
ii linux-image-extra-3.13.0-30-generic 3.13.0-30.55 amd64 Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP
ii linux-image-extra-3.13.0-32-generic 3.13.0-32.57 amd64 Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP
ii linux-image-generic 3.13.0.32.38 amd64 Generic Linux kernel image


Delete kernels

Delete the kernels you don't want/need anymore

apt-get remove --purge linux-image-VERSION linux-image-extra-VERSION
apt-get autoremove

Replace VERSION with the version of the kernel you want to remove.


Example:

apt-get remove --purge linux-image-3.13.0-24-generic linux-image-extra-3.13.0-24-generic  linux-image-3.13.0-30-generic linux-image-extra-3.13.0-30-generic
apt-get autoremove


Update kernels list

update-grub