How to clean up /boot?

Sascha Manns Sascha.Manns at mailbox.org
Wed Jan 11 08:05:54 UTC 2017


Hi,

On 08.01.2017 17:18, Peng Yu wrote:
> It doesn't work.
Maybe this one works for you.
1.) create a new textfile in a editor and place it in ~/home (eg vim
~/remove-old-kernels.sh)
2.) Fill it with that:
#!/bin/bash
dpkg -l 'linux-[ihs]*' | sed '/^ii/!d;/'"$(uname -r | sed
"s/\([-0-9]*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^
]*\).*/\1/;/[0-9]/!d' | tee to_removed
cat to_be_removed | xargs sudo apt-get -y purge
rm to_be_removed

It deletes all kernels in /boot and holds the last one.

Greetings
Sascha


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 837 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20170111/feb3fc5d/attachment.sig>


More information about the ubuntu-users mailing list