2

I recently installed Ubuntu Server 12.04 LTS. After I tried to make the very first update in a couple of days, I encountered a problem which is not new, but I think in my case it is a bit distinguished.

So, I tried to install a new kernel version. The system said there is an error, something with dependencies, so it said to try apt-get -f install instead. The output:

xxx@lab103-server:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  linux-image-3.2.0-37-generic
Suggested packages:
  fdutils linux-doc-3.2.0 linux-source-3.2.0 linux-tools
The following NEW packages will be installed:
  linux-image-3.2.0-37-generic
0 upgraded, 1 newly installed, 0 to remove and 39 not upgraded.
2 not fully installed or removed.
Need to get 0 B/38.5 MB of archives.
After this operation, 149 MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
(Reading database ... 187430 files and directories currently installed.)
Unpacking linux-image-3.2.0-37-generic (from .../linux-image-3.2.0-37-generic_3.2.0-37.58_amd64.deb) ...
Done.
dpkg: error processing /var/cache/apt/archives/linux-image-3.2.0-37-generic_3.2.0-37.58_amd64.deb (--unpack):
 failed in write on buffer copy for backend dpkg-deb during `./lib/modules/3.2.0-37-generic/kernel/drivers/usb/serial/ftdi_sio.ko': No space left on device
No apport report written because the error message indicates a disk full error
                                                                              dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.2.0-37-generic /boot/vmlinuz-3.2.0-37-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.2.0-37-generic /boot/vmlinuz-3.2.0-37-generic
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-3.2.0-37-generic_3.2.0-37.58_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

As you can see, there's not enough space somewhere. Concerning space:

xxx@lab103-server:~$ df -hT
Filesystem          Type      Size  Used Avail Use% Mounted on
/dev/mapper/vg-root ext4      330M  240M   74M  77% /
udev                devtmpfs  3.9G  8.0K  3.9G   1% /dev
tmpfs               tmpfs     1.6G  764K  1.6G   1% /run
none                tmpfs     5.0M     0  5.0M   0% /run/lock
none                tmpfs     3.9G  600K  3.9G   1% /run/shm
/dev/sda2           ext2      229M   26M  192M  12% /boot
/dev/mapper/vg-usr  ext4      8.4G  6.5G  1.5G  82% /usr
/dev/mapper/vg-var  ext4      2.8G  604M  2.1G  23% /var
/dev/mapper/vg-tmp  ext4      378M  359M     0 100% /tmp
/dev/mapper/vg-home ext4      901G   25G  831G   3% /home
/dev/sda1           vfat      190M  124K  190M   1% /boot/efi

My system information:

Linux lab103-server 3.2.0-29-generic #46-Ubuntu SMP Fri Jul 27 17:03:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

Other posts suggest to remove the old kernels to free some space before installing new ones, but in my case, I only have one kernel version!

lozovskiy@lab103-server:~$ dpkg -l | grep linux-image
ii  linux-image-3.2.0-29-generic           3.2.0-29.46                             Linux kernel image for version 3.2.0 on 64 bit x86 SMP
iU  linux-image-server                     3.2.0.37.45                             Linux kernel image on Server Equipment.

I am afraid to remove them, so I think another solution would be first increasing space of /boot? Or is it /? Which one and how to increase?

Lucio
  • 18,843

1 Answers1

1

It's possible to remove the running kernel, but I wouldn't recommend it. I'd reinstall and make sure you get enough space. Do you really need to upgrade the kernel though?

Which bootloader are you using? Using GNU Grub, it shouldn't matter much where your kernel is located, you can load it from the GNU Grub console as long as Grub can read the partition.

If you want to resize instead of reinstalling, try booting from the live-CD and running gparted. See Why I'm seeing a lock besides the partition I'm trying to modify with gparted?

  • Answering your questions, I need to update the kernel, since I can't install anything using "apt-get install". It always tells me to do "apt-get -f install" to fix dependency problem. This doesn't depend on what I want to install. I don't know about bootloader. How can I check it? Is booting from the live-CD the only option? – MajinSaha Feb 17 '13 at 20:17
  • Ok, suppose I will do it. But how do I know, which partition to resize? One of my previous questions was how to learn which partition is lacking space. The two candidates are /boot and /, since the have the least space available (not counting /tmp). – MajinSaha Feb 17 '13 at 20:24
  • try removing linux-image-3.2.0-37-generic like this: dpkg -r linux-image-3.2.0-37-generic, then run apt-get -f install. now you should be able to update again. remember to deselect the kernel upgrade. – Janus Troelsen Feb 17 '13 at 23:23
  • you can mount the partitions from the livecd and check yourself which one it is. gparted won't resize it if it's mounted, so it's relatively safe. – Janus Troelsen Feb 17 '13 at 23:23
  • Uhm, actually linux-image-3.2.0-37-generic is the one I tried to update to, so there's nothing to remove. Anyway, I typed the command you suggested and it said dpkg: warning: there's no installed package matching linux-image-3.2.0-37-generic The result of apt-get -f install was the same as before.

    What I meant was, how do I know which partition the updater needs, /boot or / ? GParted will tell me such thing?

    – MajinSaha Feb 18 '13 at 10:23