2

I'm using a no-longer-supported Ubuntu 13.10 and want to upgrade it to 14.04. However, possibly because my predecessor set the boot partition with too small a size, when running do-release-upgrade I get the following error:

The upgrade has aborted. The upgrade needs a total of 56.8 M free
space on disk '/boot'. Please free at least an additional 8,059 k of
disk space on '/boot'. Empty your trash and remove temporary packages
of former installations using 'sudo apt-get clean'.

My current disk usage with df -h /boot is:

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1        88M   34M   47M  43% /boot

Files in /boot are:

e9t@/$ ls -al /boot
drwxr-xr-x 5 root root 1.0K Sep 13  2014 [1]  grub
drwx------ 2 root root  12K Mar  5  2014 [2]  lost+found
-rw------- 1 root root 3.2M Oct 10  2013 [3]  System.map-3.11.0-12-generic
-rw-r--r-- 1 root root 983K Oct 10  2013 [4]  abi-3.11.0-12-generic
-rw-r--r-- 1 root root 160K Oct 10  2013 [5]  config-3.11.0-12-generic
-rw-r--r-- 1 root root  17M Apr  8  2014 [6]  initrd.img-3.11.0-12-generic
-rw-r--r-- 1 root root 173K Jun 17  2013 [7]  memtest86+.bin
-rw-r--r-- 1 root root 175K Jun 17  2013 [8]  memtest86+_multiboot.bin
-rw------- 1 root root 5.4M Oct 10  2013 [9]  vmlinuz-3.11.0-12-generic

Cleaning, or freeing up more space in /boot is NOT an option because my /boot is just big enough to fit the necessary files - grub, vmlinuz, and initrd.

So I'm left with the following options:

  1. Increase the partition's size (But I have to use command line and have cannot use live CD/USB because I'm working remote.)
  2. Temporarily empty /boot (or move a big file, e.g., initrd), upgrade the OS, then restore /boot (or move the big file back)

Which is the safer or preferred way? Is there a better way to fix my problem than the two options I've mentioned?

e9t
  • 195
  • 2
    I suggest a new install of 14.04 with normal partitioning without separate /boot. – Pilot6 Jul 12 '15 at 18:05
  • 1
    @EricCarvalho No, it's not a matter of freeing space, because my /boot partition is too small in the first place. – e9t Jul 13 '15 at 07:17

1 Answers1

0

Try this:

OLDCONF=$(dpkg -l|grep "^rc"|awk '{print $2}')
CURKERNEL=$(uname -r|sed 's/-*[a-z]//g'|sed 's/-386//g')
LINUXPKG="linux-(image|headers|ubuntu-modules|restricted-modules)"
METALINUXPKG="linux-(image|headers|restricted-modules)-(generic|i386|server|common|rt|xen)"
OLDKERNELS=$(dpkg -l|awk '{print $2}'|grep -E $LINUXPKG |grep -vE $METALINUXPKG|grep -v $CURKERNEL)
sudo apt-get remove --purge $OLDCONF
sudo apt-get remove --purge $OLDKERNELS
kyodake
  • 15,401
  • 1
    Thanks, but as I mentioned in the question, I have already removed all "OLDKERNELS", yet still not enough space. – e9t Jul 13 '15 at 15:12
  • Try move small /boot partition to / partition with live-dvd/usb – kyodake Jul 13 '15 at 21:04