在Ubuntu 12.04中安装更新或从软件中心时,出现错误消息

我有一台有足够磁盘空间的新电脑。 有一个固态启动驱动器和我放置文件的常规磁盘。

所以发生的主要事情是,在过去的几周里,每当我尝试安装更新或从软件中心下载时,我都会获得更新,以及软件。

有没有人知道这个问题是怎么回事?

我最近使用My Unity更改了显示器上的一些设置,几周前我终于想出了如何通过sudo chown user /mnt/data0访问大硬盘。 我也禁用了全局菜单。 这可能导致问题。 顺便说一句,我也一直遇到一些问题,显卡没有保存我的设置,所以每次打开电脑都要重置它们,即使它们在最初的几周内保存了。

 $ sudo dpkg --configure -a Setting up initramfs-tools (0.99ubuntu13.1) ... update-initramfs: deferring update (trigger activated) Setting up linux-image-3.2.0-39-generic (3.2.0-39.62) ... Running depmod. update-initramfs: deferring update (hook will be called later) The link /initrd.img is a dangling linkto /boot/initrd.img-3.2.0-39-generic Examining /etc/kernel/postinst.d. run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.2.0-39-generic /boot/vmlinuz-3.2.0-39-generic run-parts: executing /etc/kernel/postinst.d/dkms 3.2.0-39-generic /boot/vmlinuz-3.2.0-39-generic run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.2.0-39-generic /boot/vmlinuz-3.2.0-39-generic update-initramfs: Generating /boot/initrd.img-3.2.0-39-generic gzip: stdout: No space left on device E: mkinitramfs failure cpio 141 gzip 1 update-initramfs: failed for /boot/initrd.img-3.2.0-39-generic with 1. run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1 Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.2.0-39-generic.postinst line 1010. dpkg: error processing linux-image-3.2.0-39-generic (--configure): subprocess installed post-installation script returned error exit status 2 dpkg: dependency problems prevent configuration of linux-image-generic: linux-image-generic depends on linux-image-3.2.0-39-generic; however: Package linux-image-3.2.0-39-generic is not configured yet. dpkg: error processing linux-image-generic (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of linux-generic: linux-generic depends on linux-image-generic (= 3.2.0.39.47); however: Package linux-image-generic is not configured yet. dpkg: error processing linux-generic (--configure): dependency problems - leaving unconfigured Processing triggers for initramfs-tools ... update-initramfs: Generating /boot/initrd.img-3.2.0-38-generic gzip: stdout: No space left on device E: mkinitramfs failure cpio 141 gzip 1 update-initramfs: failed for /boot/initrd.img-3.2.0-38-generic with 1. dpkg: error processing initramfs-tools (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: linux-image-3.2.0-39-generic linux-image-generic linux-generic initramfs-tools 

此时我们得到一个弹出窗口说:

 Low Disk Space The volume "boot" has only 0 bytes disk space remaining. You can free up disk space by removing unused programs or files, or by moving files to another disk or partition. 

这对我们来说并没有多大意义。 当我们查看文件系统时,我们正在努力确定我们正在查看哪个驱动器,但是当我们查看带有书签的驱动器/我们认为是固态驱动器然后进入启动时我们看到不是很多文件不是​​很大 – 当然不是120演出价值。

关于驱动器:当我们大约一个月前购买电脑时,我们让公司安装了Ubuntu。 根据我们的要求,他们使120 GB的固态驱动器成为启动驱动器。 3 T驱动器似乎已安装,但安装Ubuntu的人没有让我们看到3TB驱动器,我们被拒绝查看它的权限,直到我使用上面原始消息中提到的修复程序才能够保存到驱动器。 (我似乎仍被拒绝查看“Lost and Found”文件夹的权限。)然后我将我保存在固态驱动器上的文件复制到3 T驱动器并删除了我从固体中保存的文件国家开车腾出空间。 固态硬盘仍然有很大的空间(当然是另一个)。

从我们可以看出,获得错误消息的软件和更新似乎实际上已经安装(我不知道是否正确),但每次都会生成长错误消息。 是否尝试安装到两个磁盘或类似的东西并生成错误消息,因为3 T驱动器未正确安装/安装?

对于我们所展示的任何无知感到抱歉。 我正在努力学习所有这些,但仍然不太了解文件系统,当然是一个Ubuntu新手。

更新2013年4月12日:嗨,Nikki。 非常感谢您帮助我们。 好吧,我们终于能够尝试实施这些步骤而且失败了。 我们得到以下内容(我必须删除其中一些以使其适合此消息):

 user@ubuntu:~$ sudo apt-get clean && 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-generic : Depends: linux-headers-generic (= 3.2.0.39.47) but 3.2.0.40.48 is installed E: Unmet dependencies. Try using -f. user@ubuntu:~$ uname -r 3.2.0-38-generic user@ubuntu:~$ dpkg --list | 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 ii linux-image-3.2.0-37-generic 3.2.0-37.58 Linux kernel image for version 3.2.0 on 64 bit x86 SMP ii linux-image-3.2.0-38-generic 3.2.0-38.61 Linux kernel image for version 3.2.0 on 64 bit x86 SMP iF linux-image-3.2.0-39-generic 3.2.0-39.62 Linux kernel image for version 3.2.0 on 64 bit x86 SMP iF linux-image-3.2.0-40-generic 3.2.0-40.64 Linux kernel image for version 3.2.0 on 64 bit x86 SMP iU linux-image-generic 3.2.0.39.47 Generic Linux kernel image user@ubuntu:~$ sudo apt-get purge linux-image-3.2.0.29-generic Reading package lists... Done Building dependency tree Reading state information... Done Note, selecting 'linux-image-3.2.0-29-generic' for regex 'linux-image-3.2.0.29-generic' Note, selecting 'linux-image-3.2.0-29-generic-pae' for regex 'linux-image-3.2.0.29-generic' You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: linux-generic : Depends: linux-headers-generic (= 3.2.0.39.47) but 3.2.0.40.48 is to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). user@ubuntu:~$ sudo apt-get purge linux-image-3.2.0.37-generic Reading package lists... Done Building dependency tree Reading state information... Done Note, selecting 'linux-image-3.2.0-37-generic' for regex 'linux-image-3.2.0.37-generic' Note, selecting 'linux-image-3.2.0-37-generic-pae' for regex 'linux-image-3.2.0.37-generic' You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: linux-generic : Depends: linux-headers-generic (= 3.2.0.39.47) but 3.2.0.40.48 is to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). user@ubuntu:~$ sudo apt-get purge linux-image-3.2.0.39-generic Reading package lists... Done Building dependency tree Reading state information... Done Note, selecting 'linux-image-3.2.0-39-generic' for regex 'linux-image-3.2.0.39-generic' Note, selecting 'linux-image-3.2.0-39-generic-pae' for regex 'linux-image-3.2.0.39-generic' You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: linux-generic : Depends: linux-headers-generic (= 3.2.0.39.47) but 3.2.0.40.48 is to be installed linux-image-generic : Depends: linux-image-3.2.0-39-generic but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). user@ubuntu:~$ sudo apt-get purge linux-image-3.2.0.40-generic Reading package lists... Done Building dependency tree Reading state information... Done Note, selecting 'linux-image-3.2.0-40-generic' for regex 'linux-image-3.2.0.40-generic' Note, selecting 'linux-image-3.2.0-40-generic-pae' for regex 'linux-image-3.2.0.40-generic' You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: linux-generic : Depends: linux-headers-generic (= 3.2.0.39.47) but 3.2.0.40.48 is to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). user@ubuntu:~$ sudo apt-get purge linux-image-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-generic : Depends: linux-image-generic (= 3.2.0.39.47) but it is not going to be installed Depends: linux-headers-generic (= 3.2.0.39.47) but 3.2.0.40.48 is to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). user@ubuntu:~$ sudo update-grub2 Generating grub.cfg ... Found linux image: /boot/vmlinuz-3.2.0-40-generic Found linux image: /boot/vmlinuz-3.2.0-39-generic Found linux image: /boot/vmlinuz-3.2.0-38-generic Found initrd image: /boot/initrd.img-3.2.0-38-generic Found linux image: /boot/vmlinuz-3.2.0-37-generic Found initrd image: /boot/initrd.img-3.2.0-37-generic Found linux image: /boot/vmlinuz-3.2.0-29-generic Found initrd image: /boot/initrd.img-3.2.0-29-generic done user@ubuntu:~$ sudo dpkg --configure -a Setting up initramfs-tools (0.99ubuntu13.1) ... update-initramfs: deferring update (trigger activated) Setting up linux-image-3.2.0-40-generic (3.2.0-40.64) ... Running depmod. update-initramfs: deferring update (hook will be called later) The link /initrd.img is a dangling linkto /boot/initrd.img-3.2.0-39-generic Examining /etc/kernel/postinst.d. run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.2.0-40-generic /boot/vmlinuz-3.2.0-40-generic run-parts: executing /etc/kernel/postinst.d/dkms 3.2.0-40-generic /boot/vmlinuz-3.2.0-40-generic run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.2.0-40-generic /boot/vmlinuz-3.2.0-40-generic update-initramfs: Generating /boot/initrd.img-3.2.0-40-generic gzip: stdout: No space left on device E: mkinitramfs failure cpio 141 gzip 1 update-initramfs: failed for /boot/initrd.img-3.2.0-40-generic with 1. run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1 Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.2.0-40-generic.postinst line 1010. dpkg: error processing linux-image-3.2.0-40-generic (--configure): subprocess installed post-installation script returned error exit status 2 dpkg: dependency problems prevent configuration of linux-generic: linux-generic depends on linux-headers-generic (= 3.2.0.39.47); however: Version of linux-headers-generic on system is 3.2.0.40.48. dpkg: error processing linux-generic (--configure): dependency problems - leaving unconfigured Setting up linux-image-3.2.0-39-generic (3.2.0-39.62) ... Running depmod. update-initramfs: deferring update (hook will be called later) The link /initrd.img is a dangling linkto /boot/initrd.img-3.2.0-40-generic Examining /etc/kernel/postinst.d. run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.2.0-39-generic /boot/vmlinuz-3.2.0-39-generic run-parts: executing /etc/kernel/postinst.d/dkms 3.2.0-39-generic /boot/vmlinuz-3.2.0-39-generic run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.2.0-39-generic /boot/vmlinuz-3.2.0-39-generic update-initramfs: Generating /boot/initrd.img-3.2.0-39-generic gzip: stdout: No space left on device E: mkinitramfs failure cpio 141 gzip 1 update-initramfs: failed for /boot/initrd.img-3.2.0-39-generic with 1. run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1 Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.2.0-39-generic.postinst line 1010. dpkg: error processing linux-image-3.2.0-39-generic (--configure): subprocess installed post-installation script returned error exit status 2 dpkg: dependency problems prevent configuration of linux-image-generic: linux-image-generic depends on linux-image-3.2.0-39-generic; however: Package linux-image-3.2.0-39-generic is not configured yet. dpkg: error processing linux-image-generic (--configure): dependency problems - leaving unconfigured Processing triggers for initramfs-tools ... update-initramfs: Generating /boot/initrd.img-3.2.0-38-generic gzip: stdout: No space left on device E: mkinitramfs failure cpio 141 gzip 1 update-initramfs: failed for /boot/initrd.img-3.2.0-38-generic with 1. dpkg: error processing initramfs-tools (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: linux-image-3.2.0-40-generic linux-generic linux-image-3.2.0-39-generic linux-image-generic initramfs-tools user@ubuntu:~$ 

NIKKI:DF命令的输出和你的最后命令:

 user@ubuntu:~$ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda2 19222656 5545404 12700716 31% / devtmpfs 16425020 8 16425012 1% /dev none 3291972 996 3290976 1% /run none 5120 0 5120 0% /run/lock none 16459852 736 16459116 1% /run/shm /dev/sda1 90195 89356 0 100% /boot /dev/sda5 88370448 33795068 50086420 41% /home /dev/sdb1 2884283608 184345072 2553425284 7% /mnt/data0 /dev/sdc1 488145616 404062976 84082640 83% /media/KAREN_~1DRI user@ubuntu:~$ 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 [sudo] password for user: 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-generic : Depends: linux-headers-generic (= 3.2.0.39.47) but 3.2.0.40.48 is to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). 

在你的pastebin我注意到它说

尚未配置包linux-image-generic。

尝试这样做,然后升级

sudo dpkg –configure -a

sudo apt-get install -f

sudo apt-get update && sudo apt-get upgrade

继续:

好像你的空间太空了。 你试过跑吗?

 sudo apt-get clean && sudo apt-get autoremove 

然后我建议您通过执行来检查您正在运行的内核

 uname -r 

记住它,然后检查已安装的所有内核

 dpkg --list | grep linux-image 

然后删除所有其他内核,除了你正在运行的内核。

 sudo apt-get purge linux-image-xxxx-generic 

并在删除所有运行后

 sudo update-grub2 

最后但并非最不重要的是重复上面配置内核的步骤

更新4/13/2013

嗨再次,不用担心,我们还有很多方法可以解决这个问题。 你能告诉我终端的df命令的输出吗? 也尝试在终端中运行此命令,看看它是否能够删除“不需要的内核”

 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 

我在笔记本电脑上解决它的方式:

  1. 使用以前的内核映像linux-image-3.2.0-39启动笔记本电脑
  2. 卸载最新内核: sudo apt-get purge linux-image-3.2.0-40-generic
  3. 卸载旧内核:图像sudo apt-get purge linux-image-3.2.0-35-generic
  4. 更新你的系统: sudo apt-get update && sudo apt-get upgrade
  5. 更新引导加载程序: update-grub2