依赖问题阻止了linux-headers-virtual的配置。

我在虚拟机上运行的是Ubuntu 12.04.2 LTS版本,遇到了一个小问题。每次尝试升级时,都会出现以下错误信息:
apt-get upgrade

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-headers-virtual : Depends: linux-headers-3.2.0-44-virtual but it is not installed
 linux-virtual : Depends: linux-image-virtual (= 3.2.0.44.53) but 3.2.0.45.54 is installed
E: Unmet dependencies. Try using -f.

如果我尝试使用-f install(如建议的那样),我会得到以下结果:
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-headers-virtual linux-virtual
The following packages will be upgraded:
  linux-headers-virtual linux-virtual
2 upgraded, 0 newly installed, 0 to remove and 38 not upgraded.
2 not fully installed or removed.
Need to get 0 B/4,234 B of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
dpkg: dependency problems prevent configuration of linux-headers-virtual:
 linux-headers-virtual depends on linux-headers-3.2.0-44-virtual; however:
  Package linux-headers-3.2.0-44-virtual is not installed.
dpkg: error processing linux-headers-virtual (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: dependency problems prevent configuration of linux-virtual:
 linux-virtual depends on linux-image-virtual (= 3.2.0.44.53); however:
  Version of linux-image-virtual on system is 3.2.0.45.54.
 linux-virtual depends on linux-headers-virtual (= 3.2.0.44.53); however:
  Package linux-headers-virtual is not configured yet.
dpkg: error processing linux-virtual (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
 linux-headers-virtual
 linux-virtual
E: Sub-process /usr/bin/dpkg returned an error code (1)

有关如何解决这个问题的任何想法/建议吗?提前感谢。
PS: 我已经尝试了apt-get autoremove和autoclean,但没有成功。
根据Mitch的建议,我尝试了dpkg --configure --pending,但同样没有成功。出现了相同的错误。我还尝试了另外两个建议的命令,但它们的输出并没有提供任何额外的信息。
sudo dpkg --configure --pending

dpkg: dependency problems prevent configuration of linux-headers-virtual:
 linux-headers-virtual depends on linux-headers-3.2.0-44-virtual; however:
  Package linux-headers-3.2.0-44-virtual is not installed.
dpkg: error processing linux-headers-virtual (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-virtual:
 linux-virtual depends on linux-image-virtual (= 3.2.0.44.53); however:
  Version of linux-image-virtual on system is 3.2.0.45.54.
 linux-virtual depends on linux-headers-virtual (= 3.2.0.44.53); however:
  Package linux-headers-virtual is not configured yet.
dpkg: error processing linux-virtual (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-headers-virtual
 linux-virtual

如lgarzo所请求,这里是一些信息:
uname -r
3.2.0-45-virtual

dpkg --list linux-[hi]* | cat
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                            Version                      Description
+++-===============================-============================-===================================================================
=====
un  linux-headers                   <none>                       (no description available)
un  linux-headers-3                 <none>                       (no description available)
un  linux-headers-3.0               <none>                       (no description available)
un  linux-headers-3.2.0-36          <none>                       (no description available)
un  linux-headers-3.2.0-36-virtual  <none>                       (no description available)
un  linux-headers-3.2.0-37          <none>                       (no description available)
un  linux-headers-3.2.0-37-virtual  <none>                       (no description available)
un  linux-headers-3.2.0-38          <none>                       (no description available)
un  linux-headers-3.2.0-38-virtual  <none>                       (no description available)
un  linux-headers-3.2.0-39          <none>                       (no description available)
un  linux-headers-3.2.0-39-virtual  <none>                       (no description available)
un  linux-headers-3.2.0-40          <none>                       (no description available)
un  linux-headers-3.2.0-40-virtual  <none>                       (no description available)
un  linux-headers-3.2.0-41          <none>                       (no description available)
un  linux-headers-3.2.0-41-virtual  <none>                       (no description available)
ii  linux-headers-3.2.0-43          3.2.0-43.68                  Header files related to Linux kernel version 3.2.0
ii  linux-headers-3.2.0-43-virtual  3.2.0-43.68                  Linux kernel headers for version 3.2.0 on 64 bit x86 Virtual Guests
ii  linux-headers-3.2.0-44          3.2.0-44.69                  Header files related to Linux kernel version 3.2.0
in  linux-headers-3.2.0-44-virtual  <none>                       (no description available)
ii  linux-headers-3.2.0-45          3.2.0-45.70                  Header files related to Linux kernel version 3.2.0
ii  linux-headers-3.2.0-45-virtual  3.2.0-45.70                  Linux kernel headers for version 3.2.0 on 64 bit x86 Virtual Guests
iU  linux-headers-virtual           3.2.0.44.53                  Linux kernel headers for virtual machines
un  linux-image                     <none>                       (no description available)
un  linux-image-3.0                 <none>                       (no description available)
ii  linux-image-3.2.0-23-virtual    3.2.0-23.36                  Linux kernel image for version 3.2.0 on 64 bit x86 Virtual Guests
ii  linux-image-3.2.0-30-virtual    3.2.0-30.48                  Linux kernel image for version 3.2.0 on 64 bit x86 Virtual Guests
ii  linux-image-3.2.0-31-virtual    3.2.0-31.50                  Linux kernel image for version 3.2.0 on 64 bit x86 Virtual Guests
ii  linux-image-3.2.0-32-virtual    3.2.0-32.51                  Linux kernel image for version 3.2.0 on 64 bit x86 Virtual Guests
ii  linux-image-3.2.0-33-virtual    3.2.0-33.52                  Linux kernel image for version 3.2.0 on 64 bit x86 Virtual Guests
ii  linux-image-3.2.0-34-virtual    3.2.0-34.53                  Linux kernel image for version 3.2.0 on 64 bit x86 Virtual Guests
ii  linux-image-3.2.0-35-virtual    3.2.0-35.55                  Linux kernel image for version 3.2.0 on 64 bit x86 Virtual Guests
ii  linux-image-3.2.0-36-virtual    3.2.0-36.57                  Linux kernel image for version 3.2.0 on 64 bit x86 Virtual Guests
rc  linux-image-3.2.0-37-virtual    3.2.0-37.58                  Linux kernel image for version 3.2.0 on 64 bit x86 Virtual Guests
rc  linux-image-3.2.0-38-virtual    3.2.0-38.61                  Linux kernel image for version 3.2.0 on 64 bit x86 Virtual Guests
rc  linux-image-3.2.0-39-virtual    3.2.0-39.62                  Linux kernel image for version 3.2.0 on 64 bit x86 Virtual Guests
rc  linux-image-3.2.0-40-virtual    3.2.0-40.64                  Linux kernel image for version 3.2.0 on 64 bit x86 Virtual Guests
rc  linux-image-3.2.0-41-virtual    3.2.0-41.66                  Linux kernel image for version 3.2.0 on 64 bit x86 Virtual Guests
ii  linux-image-3.2.0-43-virtual    3.2.0-43.68                  Linux kernel image for version 3.2.0 on 64 bit x86 Virtual Guests
ii  linux-image-3.2.0-44-virtual    3.2.0-44.69                  Linux kernel image for version 3.2.0 on 64 bit x86 Virtual Guests
ii  linux-image-3.2.0-45-virtual    3.2.0-45.70                  Linux kernel image for version 3.2.0 on 64 bit x86 Virtual Guests
ii  linux-image-virtual             3.2.0.45.54                  Linux kernel image for virtual machines
un  linux-initramfs-tool            <none>                       (no description available)

免费空间,如所请求:
df -h

Filesystem              Size  Used Avail Use% Mounted on
/dev/mapper/cacti-root  3.2G  1.6G  1.5G  53% /
udev                    239M  4.0K  239M   1% /dev
tmpfs                    97M  236K   97M   1% /run
none                    5.0M     0  5.0M   0% /run/lock
none                    243M     0  243M   0% /run/shm
/dev/sda1               228M   82M  134M  38% /boot

有一件事我应该提到的是,实际上我没有足够的inode剩余(df -i显示/dev/mapper/cacti-root的IUse%为100%)。我不得不手动从/usr/src/linux-headers-X.X.X-XX中删除旧版本的文件。现在,这已经不再是问题了。
首先,非常感谢您的帮助 lgarzo。 我尝试安装了linux-headers-3.2.0-44-virtual,如建议的。以下是输出结果:
dpkg --install linux-headers-3.2.0-44-virtual

dpkg: error processing linux-headers-3.2.0-44-virtual (--install):
 cannot access archive: No such file or directory
Errors were encountered while processing:
 linux-headers-3.2.0-44-virtual

经过检查 /usr/src/ 找到所需的文件,似乎确实缺少了 linux-headers-3.2.0-44-virtual 中的文件。
cd /usr/src/
ls -l

total 20
drwxr-xr-x 24 root root 4096 May 16 06:57 linux-headers-3.2.0-43
drwxr-xr-x  7 root root 4096 May 16 06:57 linux-headers-3.2.0-43-virtual
drwxr-xr-x 24 root root 4096 May 24 06:41 linux-headers-3.2.0-44
drwxr-xr-x 24 root root 4096 Jun  6 14:48 linux-headers-3.2.0-45
drwxr-xr-x  7 root root 4096 Jun  6 14:48 linux-headers-3.2.0-45-virtual

我有...-43和...-45的实体和虚拟包,但没有...-44的虚拟包。似乎在5月24日的自动升级过程中出现了inode问题,并且升级过程被中断了一半。
有没有办法下载并提取这些文件,以便dpkg --install不会失败?谢谢。
好的,看起来我们正在朝某个方向前进(希望是正确的方向)。我已经下载了 linux-headers-3.2.0-44-virtual_3.2.0-44.69_i386.deb 并尝试执行 dpkg -install。现在它因为其他原因而抱怨了 :(
# wget http://launchpadlibrarian.net/140046439/linux-headers-3.2.0-44-virtual_3.2.0-44.69_i386.deb
--2013-06-12 09:49:51--  http://launchpadlibrarian.net/140046439/linux-headers-3.2.0-44-virtual_3.2.0-44.69_i386.deb
Resolving launchpadlibrarian.net (launchpadlibrarian.net)... 91.189.89.228, 91.189.89.229
Connecting to launchpadlibrarian.net (launchpadlibrarian.net)|91.189.89.228|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 979370 (956K) [application/x-debian-package]
Saving to: `linux-headers-3.2.0-44-virtual_3.2.0-44.69_i386.deb'

100%[==========================================================================================>] 979,370     --.-K/s   in 0.04s

2013-06-12 09:49:51 (22.9 MB/s) - `linux-headers-3.2.0-44-virtual_3.2.0-44.69_i386.deb' saved [979370/979370]


# dpkg --install linux-headers-3.2.0-44-virtual_3.2.0-44.69_i386.deb
Selecting previously unselected package linux-headers-3.2.0-44-virtual:i386.
(Reading database ... 89164 files and directories currently installed.)
Unpacking linux-headers-3.2.0-44-virtual:i386 (from linux-headers-3.2.0-44-virtual_3.2.0-44.69_i386.deb) ...
dpkg: dependency problems prevent configuration of linux-headers-3.2.0-44-virtual:i386:
 linux-headers-3.2.0-44-virtual:i386 depends on linux-headers-3.2.0-44.
 linux-headers-3.2.0-44-virtual:i386 depends on libc6 (>= 2.11).
dpkg: error processing linux-headers-3.2.0-44-virtual:i386 (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-headers-3.2.0-44-virtual:i386

文件已正确提取到/usr/src/,但我想还有一些步骤需要跟进。
# cd /usr/src
# ls -l
total 24
drwxr-xr-x 24 root root 4096 May 16 06:57 linux-headers-3.2.0-43
drwxr-xr-x  7 root root 4096 May 16 06:57 linux-headers-3.2.0-43-virtual
drwxr-xr-x 24 root root 4096 May 24 06:41 linux-headers-3.2.0-44
drwxr-xr-x  7 root root 4096 Jun 12 09:37 linux-headers-3.2.0-44-virtual
drwxr-xr-x 24 root root 4096 Jun  6 14:48 linux-headers-3.2.0-45
drwxr-xr-x  7 root root 4096 Jun  6 14:48 linux-headers-3.2.0-45-virtual

有什么想法吗?(非常感谢您的耐心和支持)。
# dpkg --list linux-headers-3.2.0-44 libc6 linux-virtual | cat
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                Version                      Description
+++-===================================-============================-=============================================================
ii  libc6                               2.15-0ubuntu10.3             Embedded GNU C Library: Shared libraries
ii  linux-headers-3.2.0-44              3.2.0-44.69                  Header files related to Linux kernel version 3.2.0
iU  linux-virtual                       3.2.0.44.53                  Complete Linux kernel for virtual machines

看到了 linux-virtual 旁边的大写字母 U,我也尝试过以下方法:
# apt-get install linux-virtual
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-headers-3.2.0-44-virtual:i386 : Depends: linux-headers-3.2.0-44:i386 but it is not installable
                                       Depends: libc6:i386 (>= 2.11) but it is not going to be installed
 linux-headers-virtual : Depends: linux-headers-3.2.0-44-virtual but it is not going to be installed
 linux-virtual : Depends: linux-headers-virtual (= 3.2.0.45.54) but 3.2.0.44.53 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

这是x64的!
# dpkg --print-architecture
amd64

我觉得下载x64文件可能会有帮助;)
这是我所采取的步骤(以及它们的输出),现在我意识到这是一台64位机器。
下载并安装正确的.deb文件。
# wget http://launchpadlibrarian.net/140040575/linux-headers-3.2.0-44-virtual_3.2.0-44.69_amd64.deb
--2013-06-14 08:08:49--  http://launchpadlibrarian.net/140040575/linux-headers-3.2.0-44-virtual_3.2.0-44.69_amd64.deb
Resolving launchpadlibrarian.net (launchpadlibrarian.net)... 91.189.89.229, 91.189.89.228
Connecting to launchpadlibrarian.net (launchpadlibrarian.net)|91.189.89.229|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 983134 (960K) [application/x-debian-package]
Saving to: `linux-headers-3.2.0-44-virtual_3.2.0-44.69_amd64.deb'

100%[==========================================================================================>] 983,134      151K/s   in 20s

2013-06-14 08:09:10 (48.7 KB/s) - `linux-headers-3.2.0-44-virtual_3.2.0-44.69_amd64.deb' saved [983134/983134]

# dpkg --install linux-headers-3.2.0-44-virtual_3.2.0-44.69_amd64.deb
(Reading database ... 89164 files and directories currently installed.)
Unpacking linux-headers-3.2.0-44-virtual (from linux-headers-3.2.0-44-virtual_3.2.0-44.69_amd64.deb) ...
Setting up linux-headers-3.2.0-44-virtual (3.2.0-44.69) ...

检查 /usr/src 目录的内容

# cd /usr/src
# ls -l
total 24
drwxr-xr-x 24 root root 4096 May 16 06:57 linux-headers-3.2.0-43
drwxr-xr-x  7 root root 4096 May 16 06:57 linux-headers-3.2.0-43-virtual
drwxr-xr-x 24 root root 4096 May 24 06:41 linux-headers-3.2.0-44
drwxr-xr-x  7 root root 4096 Jun 14 08:12 linux-headers-3.2.0-44-virtual
drwxr-xr-x 24 root root 4096 Jun  6 14:48 linux-headers-3.2.0-45
drwxr-xr-x  7 root root 4096 Jun  6 14:48 linux-headers-3.2.0-45-virtual

尝试使用apt-get update & upgrade命令进行更新和升级。
# apt-get update
[...]
[Ends successfully]

# apt-get upgrade
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-virtual : Depends: linux-image-virtual (= 3.2.0.44.53) but 3.2.0.45.54 is installed
E: Unmet dependencies. Try using -f.

它失败了,抱怨着,所以我尝试使用-f(强制)标志。
# apt-get -f upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following NEW packages will be installed:
  linux-headers-3.2.0-48 linux-headers-3.2.0-48-virtual linux-image-3.2.0-48-virtual
The following packages have been kept back:
  mysql-client-5.5 mysql-server-5.5 mysql-server-core-5.5
The following packages will be upgraded:
  aptitude bash dmsetup isc-dhcp-client isc-dhcp-common libc-bin libc6 libdbus-1-3 libdevmapper-event1.02.1 libdevmapper1.02.1
  libdrm-intel1 libdrm-nouveau1a libdrm-radeon1 libdrm2 libgnutls26 libmysqlclient18 libplymouth2 libssl1.0.0 libudev0 libx11-6
  libx11-data libxcb-render0 libxcb-shm0 libxcb1 libxrender1 linux-headers-virtual linux-image-virtual linux-virtual lvm2
  multiarch-support mysql-client-core-5.5 mysql-common mysql-server openssl plymouth python-apt python-apt-common rsyslog udev
39 upgraded, 3 newly installed, 0 to remove and 3 not upgraded.
2 not fully installed or removed.
Need to get 42.6 MB of archives.
After this operation, 102 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://es.archive.ubuntu.com/ubuntu/ precise-updates/main linux-image-3.2.0-48-virtual amd64 3.2.0-48.74 [12.5 MB]
Get:2 http://es.archive.ubuntu.com/ubuntu/ precise-updates/main linux-virtual amd64 3.2.0.48.58 [1,758 B]
Get:3 http://es.archive.ubuntu.com/ubuntu/ precise-updates/main linux-image-virtual amd64 3.2.0.48.58 [2,390 B]
Get:4 http://es.archive.ubuntu.com/ubuntu/ precise-updates/main linux-headers-3.2.0-48 all 3.2.0-48.74 [11.7 MB]
Get:5 http://es.archive.ubuntu.com/ubuntu/ precise-updates/main libc-bin amd64 2.15-0ubuntu10.4 [1,181 kB]
Get:6 http://es.archive.ubuntu.com/ubuntu/ precise-updates/main libc6 amd64 2.15-0ubuntu10.4 [4,653 kB]
[...]
Found linux image: /boot/vmlinuz-3.2.0-43-virtual
Found initrd image: /boot/initrd.img-3.2.0-43-virtual
Found linux image: /boot/vmlinuz-3.2.0-36-virtual
Found initrd image: /boot/initrd.img-3.2.0-36-virtual
Found linux image: /boot/vmlinuz-3.2.0-35-virtual
Found initrd image: /boot/initrd.img-3.2.0-35-virtual
Found linux image: /boot/vmlinuz-3.2.0-34-virtual
Found initrd image: /boot/initrd.img-3.2.0-34-virtual
done
Setting up linux-image-virtual (3.2.0.48.58) ...
Setting up linux-headers-3.2.0-48 (3.2.0-48.74) ...
Setting up linux-headers-3.2.0-48-virtual (3.2.0-48.74) ...
Setting up linux-headers-virtual (3.2.0.44.53) ...
dpkg: dependency problems prevent configuration of linux-virtual:
 linux-virtual depends on linux-image-virtual (= 3.2.0.44.53); however:
  Version of linux-image-virtual on system is 3.2.0.48.58.
dpkg: error processing linux-virtual (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Setting up libdbus-1-3 (1.4.18-1ubuntu1.4) ...
Setting up libdrm2 (2.4.43-0ubuntu0.0.1) ...
Setting up libdrm-intel1 (2.4.43-0ubuntu0.0.1) ...
Setting up libdrm-nouveau1a (2.4.43-0ubuntu0.0.1) ...
[...]
update-initramfs: deferring update (trigger activated)
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-3.2.0-48-virtual
Errors were encountered while processing:
 linux-virtual
E: Sub-process /usr/bin/dpkg returned an error code (1)
#

它又失败了,还抱怨linux-virtual。唯一的区别是,由于我使用了-f(orce)标志运行,现在我也安装了3.2.0.48.58。
之前的抱怨是:
linux-virtual依赖于linux-image-virtual (= 3.2.0.44.53),但安装的是3.2.0.45.54。
现在变成了:
linux-virtual依赖于linux-image-virtual (= 3.2.0.44.53),但安装的是3.2.0.48.58。
#  dpkg --configure linux-virtual
dpkg: dependency problems prevent configuration of linux-virtual:
 linux-virtual depends on linux-image-virtual (= 3.2.0.44.53); however:
  Version of linux-image-virtual on system is 3.2.0.48.58.
dpkg: error processing linux-virtual (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-virtual

# ls -l /usr/src
total 32
drwxr-xr-x 24 root root 4096 May 16 06:57 linux-headers-3.2.0-43
drwxr-xr-x  7 root root 4096 May 16 06:57 linux-headers-3.2.0-43-virtual
drwxr-xr-x 24 root root 4096 May 24 06:41 linux-headers-3.2.0-44
drwxr-xr-x  7 root root 4096 Jun 14 08:12 linux-headers-3.2.0-44-virtual
drwxr-xr-x 24 root root 4096 Jun  6 14:48 linux-headers-3.2.0-45
drwxr-xr-x  7 root root 4096 Jun  6 14:48 linux-headers-3.2.0-45-virtual
drwxr-xr-x 24 root root 4096 Jun 14 08:16 linux-headers-3.2.0-48
drwxr-xr-x  7 root root 4096 Jun 14 08:16 linux-headers-3.2.0-48-virtual

# dpkg --list linux-headers-3.2.0-44 libc6 linux-virtual | cat
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                Version                      Description
+++-===================================-============================-===============================================================
ii  libc6                               2.15-0ubuntu10.4             Embedded GNU C Library: Shared libraries
ii  linux-headers-3.2.0-44              3.2.0-44.69                  Header files related to Linux kernel version 3.2.0
iU  linux-virtual                       3.2.0.44.53                  Complete Linux kernel for virtual machines

# uname -r
3.2.0-45-virtual

还有其他想法吗?
如果你仍然认为最简单的方法是回退到先前的内核版本,然后再从那里进行更新,我认为我们可以使用3.2.0.43版本。因为我在/usr/src/下有linux-headers-3.2.0-43和linux-headers-3.2.0-43-virtual,并且/boot/目录中也有所有所需的文件。
# ls -l /boot/*3.2.0-43*
-rw-r--r-- 1 root root  794949 May 15 06:33 /boot/abi-3.2.0-43-virtual
-rw-r--r-- 1 root root  140637 May 15 06:33 /boot/config-3.2.0-43-virtual
-rw-r--r-- 1 root root 4791807 May 16 06:57 /boot/initrd.img-3.2.0-43-virtual
-rw------- 1 root root 2890123 May 15 06:33 /boot/System.map-3.2.0-43-virtual
-rw------- 1 root root 4961104 May 15 06:33 /boot/vmlinuz-3.2.0-43-virtual

谢谢。
它也阻止了我安装它。
# wget http://launchpadlibrarian.net/141816244/linux-virtual_3.2.0.48.58_amd64.deb
--2013-06-14 11:42:37--  http://launchpadlibrarian.net/141816244/linux-virtual_3.2.0.48.58_amd64.deb
Resolving launchpadlibrarian.net (launchpadlibrarian.net)... 91.189.89.228, 91.189.89.229
Connecting to launchpadlibrarian.net (launchpadlibrarian.net)|91.189.89.228|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1758 (1.7K) [application/x-debian-package]
Saving to: `linux-virtual_3.2.0.48.58_amd64.deb'

100%[==========================================================================================>] 1,758       --.-K/s   in 0s

2013-06-14 11:42:37 (184 MB/s) - `linux-virtual_3.2.0.48.58_amd64.deb' saved [1758/1758]

# dpkg --install linux-virtual_3.2.0.48.58_amd64.deb
(Reading database ... 120232 files and directories currently installed.)
Preparing to replace linux-virtual 3.2.0.44.53 (using linux-virtual_3.2.0.48.58_amd64.deb) ...
Unpacking replacement linux-virtual ...
dpkg: dependency problems prevent configuration of linux-virtual:
 linux-virtual depends on linux-headers-virtual (= 3.2.0.48.58); however:
  Version of linux-headers-virtual on system is 3.2.0.44.53.
dpkg: error processing linux-virtual (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-virtual

下载这两个 .deb 文件

# wget http://launchpadlibrarian.net/141821073/linux-headers-3.2.0-48-virtual_3.2.0-48.74_amd64.deb
[...]

# wget http://launchpadlibrarian.net/141823437/linux-headers-3.2.0-48_3.2.0-48.74_all.deb
[...]

安装它们。
# dpkg --install linux-headers-3.2.0-48-virtual_3.2.0-48.74_amd64.deb
(Reading database ... 120232 files and directories currently installed.)
Preparing to replace linux-headers-3.2.0-48-virtual 3.2.0-48.74 (using linux-headers-3.2.0-48-virtual_3.2.0-48.74_amd64.deb) ...
Unpacking replacement linux-headers-3.2.0-48-virtual ...
Setting up linux-headers-3.2.0-48-virtual (3.2.0-48.74) ...

# dpkg --install linux-headers-3.2.0-48_3.2.0-48.74_all.deb
(Reading database ... 120232 files and directories currently installed.)
Preparing to replace linux-headers-3.2.0-48 3.2.0-48.74 (using linux-headers-3.2.0-48_3.2.0-48.74_all.deb) ...
Unpacking replacement linux-headers-3.2.0-48 ...
Setting up linux-headers-3.2.0-48 (3.2.0-48.74) ...

尝试安装原始的 .deb 包,其依赖项未满足。
# dpkg --install linux-virtual_3.2.0.48.58_amd64.deb
(Reading database ... 120232 files and directories currently installed.)
Preparing to replace linux-virtual 3.2.0.48.58 (using linux-virtual_3.2.0.48.58_amd64.deb) ...
Unpacking replacement linux-virtual ...
dpkg: dependency problems prevent configuration of linux-virtual:
 linux-virtual depends on linux-headers-virtual (= 3.2.0.48.58); however:
  Version of linux-headers-virtual on system is 3.2.0.44.53.
dpkg: error processing linux-virtual (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-virtual

既然它还在抱怨,我猜我应该下载并安装缺失的软件包。这一步我自己来做 :)
# wget http://launchpadlibrarian.net/141816242/linux-headers-virtual_3.2.0.48.58_amd64.deb
[...]

# dpkg --install linux-headers-virtual_3.2.0.48.58_amd64.deb
(Reading database ... 120232 files and directories currently installed.)
Preparing to replace linux-headers-virtual 3.2.0.44.53 (using linux-headers-virtual_3.2.0.48.58_amd64.deb) ...
Unpacking replacement linux-headers-virtual ...
Setting up linux-headers-virtual (3.2.0.48.58) ...

尝试安装导致错误的软件包。
# dpkg --install linux-virtual_3.2.0.48.58_amd64.deb
(Reading database ... 120232 files and directories currently installed.)
Preparing to replace linux-virtual 3.2.0.48.58 (using linux-virtual_3.2.0.48.58_amd64.deb) ...
Unpacking replacement linux-virtual ...
Setting up linux-virtual (3.2.0.48.58) ...

最后终于成功了!!!!!

# apt-get update
[...]

# apt-get upgrade
[...]

一切都很好,没有错误。非常感谢lgarzo!!!
请以回答的形式发表一些内容(而不是评论),这样我就可以给你无价的帮助打分了。
干杯。

你能否包含uname -rdpkg --list linux-[hi]* | cat的输出,以获取当前使用的内核版本和已安装的内核的大致情况? - lgarzo
请你运行 df -h 命令,检查一下你的系统是否有空闲空间? - lgarzo
我认为问题的根源是某个时候缺少了自由空间/索引节点。我认为通过使用dpkg --install linux-headers-3.2.0-44-virtual安装linux-headers-3.2.0-44-virtual可以修复头部部分。如果您在安装之前创建一个快照,那将防止出现任何问题时带来的困扰。 - lgarzo
尝试从Linux内核启动器页面下载它。点击“所有软件包”,选择“Precise”发行系列和“linux”源软件包,然后选择您要查找的版本。点击适当的二进制软件包,并从列表中选择您的软件包。查看可下载的文件。将其保存在一个目录中,cd进入该目录,使用dpkg --install file_name.deb安装软件包。确保在运行dpkg --list查询之前离开该目录。 - lgarzo
你安装了依赖项吗?(dpkg --list linux-headers-3.2.0-44 libc6 linux-virtual | cat)应该已经安装了头文件,因为OP列出了这一点。(最后一个软件包与问题的第二部分有关。) - lgarzo
我担心我可能建议您下载了错误版本的头文件包(我不认为是这样),或者您没有安装依赖项(这似乎不是问题所在)。此时,我可能不知道足够的打包系统知识来提供帮助。让我困扰的是,依赖项明确指出“...:i386”,这可能是问题所在。如果还没有问题,这可能会成为一个好问题。另一个解决方案可能是回退到(引导)旧内核,使用“dpkg --remove”删除有问题的软件包,然后尝试“apt-get”。 - lgarzo
还有一件事:dpkg --print-architecture 显示的是什么? - lgarzo
很高兴你找出了错误的架构“bug”。我想知道如果你安装了3.2.0.48.58版本的linux-virtual,是否能解决问题。它在同一内核页面的linux-meta源软件包中:linux-virtual。我的观点是它应该依赖于你最新安装的镜像,因此=的依赖关系将会满足。 - lgarzo
所以你也需要该版本的头文件。linux-headers-virtuallinux-headers - lgarzo
谢谢你提出这个具有挑战性的问题。尝试解决它让我受益匪浅! - lgarzo
4个回答

一个简单得多的解决方案,不需要手动下载软件包或绕过软件包签名等步骤。
sudo apt-get remove linux-headers-virtual linux-virtual  
sudo apt-get install linux-headers-virtual linux-virtual
sudo apt-get -f install
sudo apt-get autoremove

最后两个步骤是可选的,分别用于验证安装和清理工作。

我之前也遇到了完全相同的问题,而这些命令完全解决了它。谢谢!!! - James Thigpen
应该是正确的答案 - Garreth McDaid
我很感激这个被接受的答案,因为它让我对问题有了一些了解。但是这个要简单得多! - Pete
在我的情况下没有起作用:sudo apt-get remove linux-headers-server linux-image-server 正在读取软件包列表... 完成 正在构建依赖关系树
正在读取状态信息... 完成 您可能需要运行 'apt-get -f install' 来纠正这些问题: 以下软件包有未满足的依赖关系: linux-server : 依赖于:linux-image-server (= 3.2.0.122.137) 但是它将不会被安装 依赖于:linux-headers-server (= 3.2.0.122.137) 但是它将不会被安装 E: 未满足的依赖关系。尝试使用无软件包的 'apt-get -f install'(或指定一个解决方案)。
- Anthony O.
最后终于成功了,但是我不得不指定所有的软件包:sudo apt-get remove linux-headers-3.2.0-122-generic linux-headers-server linux-server 然后重新安装 linux-headers-serverlinux-server - Anthony O.

前言:这是一个问答环节。本答案总结了解决方案的步骤(省略了一些死胡同)。
首先,我们需要一些关于系统的信息。(可以通过打开终端窗口并在提示符下运行给定的命令来检索。):
- 当前使用的内核:`uname -r` - 当前安装的内核和头文件包:`dpkg --list linux-[hi]* | cat` - 当前架构:`dpkg --print-architecture` - 系统中的可用磁盘空间:`df -h` - 系统中的可用inode数:`df -i`
未满足依赖问题的根源是某个时间点上的磁盘空间/节点不足。在安装内核/头文件时,建议始终在`/lib`(或者如果您在安装过程中使用了自动分区方法,则为`/root`)中至少有150 MB的可用空间。此外,可用inode数不应接近100%,因为许多文件都会随这些软件包一起安装。
在确保有足够的空间来存放这些文件后,我们开始通过下载并使用dpkg --install package.deb来安装缺失的软件包。(请注意,在手动安装软件包时,您需要负责满足软件包的依赖关系。在这种情况下,我们无法使用apt,因为系统处于不一致状态,它无法正常工作。)
我们需要确定哪些软件包丢失了。这可以从dpkgapt)命令的依赖错误消息中得到提示。
为了满足第一个依赖关系:
linux-headers-virtual : Depends: linux-headers-3.2.0-44-virtual but it is not installed

以下是所需的软件包:
  • linux-headers-3.2.0-44-virtual_3.2.0-44.69_amd64.deb
为了满足第二(和更多)的依赖关系:
linux-virtual : Depends: linux-image-virtual (= 3.2.0.44.53) but 3.2.0.45.54 is installed

以下是所需的软件包:
  • linux-virtual_3.2.0.48.58_amd64.deb
  • linux-headers-3.2.0-48-virtual_3.2.0-48.74_amd64.deb
  • linux-headers-3.2.0-48_3.2.0-48.74_all.deb
  • linux-headers-virtual_3.2.0.48.58_amd64.deb
定位软件包有点像寻宝游戏。但是你可以通过以下方法找到它们:
  • 打开Linux内核启动页面
  • 点击“所有软件包”,
  • 选择“Precise”发行系列和“linux”或“linux-meta”源软件包,然后
  • 选择你要找的版本。
  • 点击适当的二进制软件包,
  • 从列表中选择你的软件包。
  • 查看可下载的文件。

要安装已下载的软件包:

  • 将其保存在一个目录中,
  • cd进入该目录,
  • 使用dpkg --install downloaded_package_name.deb命令来安装软件包。

在运行dpkg --list查询之前,请确保离开该目录。

满足所有依赖关系后,你可以运行

apt-get update && apt-get upgrade

不应该出现任何错误消息。由于系统在一段时间内无法自动更新,可能存在新的/更新的软件包。


试试这个。只需在键盘上按下Ctrl+Alt+T即可打开终端。当终端打开后,运行以下命令:
sudo dpkg --configure --pending
sudo apt-get clean
sudo apt-get update && sudo apt-get upgrade

感谢您的快速回复。请查看对原问题的修改。第一个命令中有相同的错误。还有其他的想法吗? - jagb

只是想说我也面临同样的问题。没人提到过,但这难道不是 apt 的一个 bug 吗?我的意思是,如果我们可以强制安装一些软件包并手动修复问题,apt 不应该能够自己解决所有这些,并完成必要的工作吗?

我有一个小的 /boot 分区,一段时间后安装了太多内核导致分区满了。我开始收到类似的错误消息,我不会在这里重复信息,因为它们与已经报告的完全相同。

这条信息的目的只是提醒大家关注这个问题,它正在影响其他人,并使得 apt 在不能正常应用安全更新时处于一种状态。对于一个面向互联网的服务器来说,如果 apt 出现问题,一个关键的安全漏洞没有被及时修补,可能会变成一场噩梦。