Im试图在正在运行的Ubuntu 14.04上安装新软件
$ uname -r 3.13.0-45-generic
我的机器上安装了旧版本
$ dpkg --list | grep linux-image rc linux-image-3.13.0-24-generic 3.13.0-24.47 amd64 Linux kernel image for version 3.13.0 on 64 bit x86 SMP ii linux-image-3.13.0-45-generic 3.13.0-45.74 amd64 Linux kernel image for version 3.13.0 on 64 bit x86 SMP ii linux-image-3.13.0-55-generic 3.13.0-55.94 amd64 Linux kernel image for version 3.13.0 on 64 bit x86 SMP ii linux-image-3.13.0-57-generic 3.13.0-57.95 amd64 Linux kernel image for version 3.13.0 on 64 bit x86 SMP ii linux-image-3.13.0-58-generic 3.13.0-58.97 amd64 Linux kernel image for version 3.13.0 on 64 bit x86 SMP ii linux-image-3.13.0-59-generic 3.13.0-59.98 amd64 Linux kernel image for version 3.13.0 on 64 bit x86 SMP ii linux-image-3.13.0-61-generic 3.13.0-61.100 amd64 Linux kernel image for version 3.13.0 on 64 bit x86 SMP rc linux-image-extra-3.13.0-24-generic 3.13.0-24.47 amd64 Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP ii linux-image-extra-3.13.0-45-generic 3.13.0-45.74 amd64 Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP ii linux-image-extra-3.13.0-55-generic 3.13.0-55.94 amd64 Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP ii linux-image-extra-3.13.0-57-generic 3.13.0-57.95 amd64 Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP ii linux-image-extra-3.13.0-58-generic 3.13.0-58.97 amd64 Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP ii linux-image-extra-3.13.0-59-generic 3.13.0-59.98 amd64 Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP iF linux-image-extra-3.13.0-61-generic 3.13.0-61.100 amd64 Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP iU linux-image-extra-3.13.0-62-generic 3.13.0-62.102 amd64 Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP iU linux-image-generic 3.13.0.62.69 amd64 Generic Linux kernel image
当我试图清除他们使用下面的命令
$ sudo apt-get purge linux-image-3.13.0-24-generic Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: linux-image-extra-3.13.0-62-generic : Depends: linux-image-3.13.0-62-generic but it is not going to be installed linux-image-generic : Depends: linux-image-3.13.0-62-generic but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
我得到以上错误。
在做自动删除获取错误
$ sudo apt-get autoremove Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt-get -f install' to correct these. The following packages have unmet dependencies: linux-image-extra-3.13.0-62-generic : Depends: linux-image-3.13.0-62-generic but it is not installed linux-image-generic : Depends: linux-image-3.13.0-62-generic but it is not installed E: Unmet dependencies. Try using -f.
如果我运行强制安装它是说没有空间留在设备上..
$ sudo apt-get install -f Reading package lists... Done Building dependency tree Reading state information... Done Correcting dependencies... Done The following packages were automatically installed and are no longer required: linux-headers-3.13.0-55 linux-headers-3.13.0-55-generic linux-headers-3.13.0-57 linux-headers-3.13.0-57-generic linux-headers-3.13.0-58 linux-headers-3.13.0-58-generic linux-headers-3.13.0-59 linux-headers-3.13.0-59-generic linux-image-3.13.0-55-generic linux-image-3.13.0-57-generic linux-image-3.13.0-58-generic linux-image-3.13.0-59-generic linux-image-extra-3.13.0-55-generic linux-image-extra-3.13.0-57-generic linux-image-extra-3.13.0-58-generic linux-image-extra-3.13.0-59-generic Use 'apt-get autoremove' to remove them. The following extra packages will be installed: linux-image-3.13.0-62-generic Suggested packages: fdutils linux-doc-3.13.0 linux-source-3.13.0 linux-tools The following NEW packages will be installed: linux-image-3.13.0-62-generic 0 upgraded, 1 newly installed, 0 to remove and 48 not upgraded. 5 not fully installed or removed. Need to get 15.2 MB of archives. After this operation, 42.5 MB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://mirrors.voxel.net/ubuntu/ trusty-updates/main linux-image-3.13.0-62-generic amd64 3.13.0-62.102 [15.2 MB] Fetched 15.2 MB in 4s (3,237 kB/s) (Reading database ... 243451 files and directories currently installed.) Preparing to unpack .../linux-image-3.13.0-62-generic_3.13.0-62.102_amd64.deb ... Done. Unpacking linux-image-3.13.0-62-generic (3.13.0-62.102) ... dpkg: error processing archive /var/cache/apt/archives/linux-image-3.13.0-62-generic_3.13.0-62.102_amd64.deb (--unpack): cannot copy extracted data for './boot/vmlinuz-3.13.0-62-generic' to '/boot/vmlinuz-3.13.0-62-generic.dpkg-new': failed to write (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.13.0-62-generic /boot/vmlinuz-3.13.0-62-generic run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.13.0-62-generic /boot/vmlinuz-3.13.0-62-generic Errors were encountered while processing: /var/cache/apt/archives/linux-image-3.13.0-62-generic_3.13.0-62.102_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)
我的磁盘利用率:
$ df -k Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda3 955997652 5241596 911812456 1% / none 4 0 4 0% /sys/fs/cgroup udev 4066160 12 4066148 1% /dev tmpfs 815404 512 814892 1% /run none 5120 0 5120 0% /run/lock none 4077016 0 4077016 0% /run/shm none 102400 0 102400 0% /run/user /dev/sda1 190346 152098 24199 87% /boot
我怎样才能让我的Ubuntu的空间,以便我可以安装新的应用程序呢?
请帮忙…
你是对的,你有很多磁盘空间,但是当你试图解压新映像时,你很快就会填满/boot ,这就是为什么你的apt-get install -f命令失败。
有问题的软件包在你的dpkg输出和apt-get输出中。
您可以尝试使用aptitude install -f来查看是否有一个选项可以为您解决问题(可能通过删除这些软件包),或者您可以尝试apt-get purge linux-image-extra-3.13.0-61-generic linux-image-extra-3.13.0-62-generic linux-image-generic用于删除已安装的已损坏部分configuration的软件包。
如果您非常渴望使用dpkg务必在尝试删除程序包之前注意消息并删除程序包上的依赖项。 从上面的命令中,你可能应该删除linux-image-extra-3.13.0-55-generic然后试图删除linux-image-3.13.0-55-generic如果你想去那个路由。
请特别注意确保不要删除正在运行的内核3.13.0-45-generic 。
然后,你可以apt-get autoremove和apt-get purge剩余的不需要的内核包,然后安装后来的内核,它看起来像你试图安装。
你的根文件系统( / )有足够的可用空间,但是/boot不是。
仔细看一下sudo apt-get install -f命令的错误输出:
Unpacking linux-image-3.13.0-62-generic (3.13.0-62.102) ... dpkg: error processing archive /var/cache/apt/archives/linux-image-3.13.0-62-generic_3.13.0-62.102_amd64.deb (--unpack): cannot copy extracted data for './boot/vmlinuz-3.13.0-62-generic' to '/boot/vmlinuz-3.13.0-62-generic.dpkg-new': failed to write (No space left on device)
它试图将文件放置在/boot并且该文件系统没有足够的空间。
您的select:
/boot中删除不再需要的文件 /boot添加更多空间。 由于LVM没有被使用,这个可能很难做到。 如果这是一个虚拟机可能不是。 /boot 。 在大多数情况下,为/boot分配文件系统是不必要的。 ( 在考虑这个之前,看一下@ Kassandry的回答 ) 如果您决定摆脱/boot文件系统,您可以执行以下操作。
注:如果使用以下说明,请务必小心 :
mkdir ~/copy-of-boot-files sudo rsync -aHS /boot/ ~/copy-of-boot-files/ sudo umount /boot sudo rsync -AHS ~/copy-of-boot-files/ /boot/ sudo sed -i 's/.*\/boot.*/#&/' /etc/fstab
再次:如果你这样做,要非常小心 。 确保你有Ubuntu的安装介质,所以你可以启动到Linux救援模式,以修复任何可能造成的损害。 如果操作不当,可能导致系统无法启动 。
基本上你会创build一个/boot的内容副本,unmount / boot,将内容复制回来,并在启动过程中禁止/boot被挂载。
附加说明 :您可能需要更新自举程序configuration(例如update-grub ,不知道Ubuntu使用的是什么版本)。 另外,如果这是Xen下的准虚拟客户机,则需要确保domUconfiguration知道从新位置( sda3而不是sda1 )检索内核。