[SFS] Fwd: When you can't update Debian or Ubuntu, because /boot
is too full
Ski Dawg
skidawg@skidawg.org
Wed, 9 Apr 2014 18:05:37 -0600
I have used this quite a few times in the past to perform that task
sudo apt-get remove --purge $(dpkg -l 'linux-*' | sed
'/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]*
[^ ]* \([^ ]*\).*/\1/;/[0-9]/!d')
-- or if I want to run in a cron --
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed
"s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^
]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge
I got these commands from
http://askubuntu.com/questions/2793/how-do-i-remove-or-hide-old-kernel-versions-to-clean-up-the-boot-menu-or-free-sp
--
Doug
Registered Linux User #285548 (http://counter.li.org)
----------------------------------------
The greater danger for most of us lies not in setting our aim too high
and falling short; but in setting our aim too low, and achieving our mark.
-- Michelangelo Buonarroti
On Wed, Apr 9, 2014 at 4:21 PM, David L. Willson <DLWillson@thegeek.nu> wrote:
> Somebody asked me this, and it actually comes up kinda frequently, so I
> figured I'd share it here.
> ________________________________
>
> When you can't update Debian or Ubuntu, because /boot is too full, try this:
> ________________________________
>
> # Try this:
>
> ls -ltr /boot
>
> # Now, with your oldest version number (probably at the top of that
> listing), do something like this:
>
> dpkg -l | grep 3.2.0-29
>
> # Now, remove those packages with something like this:
>
> sudo apt-get purge linux-image-3.2.0-29-generic
> linux-headers-3.2.0-29-generic linux-headers-3.2.0-29
>
> # Keep doing that until your /boot is only around half full
>
> df -h /boot
>
>
>