Packages: Difference between revisions

m Text replacement - "<(\/?)source" to "<$1syntaxhighlight"
No edit summary
Line 41: Line 41:
dpkg -l linux-image* | awk '/^ii/ { print $2 }' | grep -P '[0-9]+\.[0-9]+\.[0-9\-]+[0-9]+'
dpkg -l linux-image* | awk '/^ii/ { print $2 }' | grep -P '[0-9]+\.[0-9]+\.[0-9\-]+[0-9]+'
</syntaxhighlight>
</syntaxhighlight>
Manually compose an <code>apt-get purge</code> invocation of the kernels you don't want (keep the running kernel and the prior as a fallback).
You might also have several '''removed''' kernels with the configuration files still hanging around. These will be marked with status '''rc''' (remove configured) instead of 'ii' like in the awk command above. So, use something like <syntaxhighlight lang="bash">
echo "apt purge $(dpkg -l | egrep '^rc' | awk 'ORS=" " {print $2}')"
</syntaxhighlight>Manually compose an <code>apt-get purge</code> invocation of the kernels you don't want (keep the running kernel and the prior as a fallback).
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
sudo apt-get -y purge linux-image-3.13.0-44-generic linux-image-3.13.0-46-generic linux-image-3.13.0-48-generic linux-image-3.13.0-55-generic linux-image-3.13.0-71-generic linux-image-3.13.0-74-generic
sudo apt-get -y purge linux-image-3.13.0-44-generic linux-image-3.13.0-46-generic linux-image-3.13.0-48-generic linux-image-3.13.0-55-generic linux-image-3.13.0-71-generic linux-image-3.13.0-74-generic