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

在 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 GB。

关于驱动器:大约一个月前,我们购买电脑时,让公司安装了 Ubuntu。他们按照我们的要求将 120 GB 的固态驱动器设为启动驱动器。3 T 驱动器似乎已安装,但安装 Ubuntu 的人没有让我们看到 3 TB 驱动器,我们被拒绝查看它,直到我使用我在上面的原始消息中提到的修复程序,以便能够保存到驱动器。(但我似乎仍然被拒绝查看“失物招领”文件夹。)然后,我将我保存在固态驱动器上的文件复制到 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).

答案1

在你的 pastebin 中我注意到它说

软件包 linux-image-generic 尚未配置。

尝试这样做然后升级

sudo dpkg--configure-a

sudo apt-get 安装 -f

sudo apt-get 更新 && sudo apt-get 升级

继续:

似乎空间不够了。你试过跑

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

然后我建议你通过执行来检查你现在正在运行哪个内核

uname -r

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

dpkg --list | grep linux-image 

然后删除除您正在运行的内核之外的所有其他内核。

sudo apt-get purge linux-image-x.x.x.x-generic

删除所有运行后

sudo update-grub2 

最后,重复上述步骤,配置内核

更新日期:2013/4/13

再次问好,不用担心,我们还有很多方法可以尝试解决这个问题。你能给我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

答案2

我在笔记本电脑上解决问题的方法:

  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

相关内容