我无法安装更新,因为我需要更多空间

我无法安装更新,因为我需要更多空间

我最近安装了 Ubuntu Server 12.04 LTS。几天后,我尝试进行第一次更新,遇到了一个问题,虽然这不是什么新鲜事,但我认为对我来说,这个问题有点突出。

于是,我尝试安装一个新的内核版本。系统说有错误,有依赖项,所以它建议尝试一下apt-get -f install。输出:

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)

如您所见,某处没有足够的空间。关于空间:

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

我的系统信息:

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

其他帖子建议在安装新内核之前删除旧内核以释放一些空间,但就我而言,我只有一个内核版本!

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.

我害怕删除它们,所以我认为另一个解决方案是首先增加空间/boot?或者是/?哪一个以及如何增加?

答案1

可以删除正在运行的内核,但我不建议这样做。我会重新安装并确保有足够的空间。但是你真的需要升级内核吗?

您使用的是哪个引导程序?使用 GNU Grub,内核位于何处并不重要,只要 Grub 可以读取分区,您就可以从 GNU Grub 控制台加载它。

如果您想要调整大小而不是重新安装,请尝试从 Live CD 启动并运行gparted。请参阅为什么我在尝试使用 gparted 修改的分区旁边看到一个锁?

相关内容