从昨天开始,我一直在尝试将系统升级到最新版本。我使用的是 Ubuntu Server 12.04.2 LTS。当我尝试升级系统时,发生了最奇怪的事情。以下是能力升级
frank@spoon:~$ sudo aptitude upgrade
The following partially installed packages will be configured:
initramfs-tools linux-generic linux-image-3.2.0-39-generic linux-image-generic linux-image-server
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
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)
Use of chdir('') or chdir(undef) as chdir() is deprecated at /var/lib/dpkg/info/linux-image-3.2.0-39-generic.postinst line 235.
Failed to symbolic-link /boot/initrd.img-3.2.0-39-generic to initrd.img:File exists at /var/lib/dpkg/info/linux-image-3.2.0-39-generic.postinst line 614.
dpkg: error processing linux-image-3.2.0-39-generic (--configure):
subprocess installed post-installation script returned error exit status 17
No apport report written because MaxReports has already been reached
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
No apport report written because MaxReports has already been reached
No apport report written because MaxReports has already been reached
dpkg: dependency problems prevent configuration of linux-image-server:
linux-image-server 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-server (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports has already been reached
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-3.2.0-38-generic
E: /usr/share/initramfs-tools/hooks/ntfs_3g failed with return 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
No apport report written because MaxReports has already been reached
Errors were encountered while processing:
linux-image-3.2.0-39-generic
linux-image-generic
linux-generic
linux-image-server
initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
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)
Use of chdir('') or chdir(undef) as chdir() is deprecated at /var/lib/dpkg/info/linux-image-3.2.0-39-generic.postinst line 235.
Failed to symbolic-link /boot/initrd.img-3.2.0-39-generic to initrd.img:File exists at /var/lib/dpkg/info/linux-image-3.2.0-39-generic.postinst line 614.
dpkg: error processing linux-image-3.2.0-39-generic (--configure):
subprocess installed post-installation script returned error exit status 17
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-image-server:
linux-image-server 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-server (--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
E: /usr/share/initramfs-tools/hooks/ntfs_3g failed with return 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-image-server
linux-generic
initramfs-tools
奇怪的是,当我查看我的主文件夹时,我看到了符号链接/boot/vmlinuz-3.2.0-39-通用并/boot/initrd.img-3.2.0-39-通用。这是我的主文件夹列表。
frank@spoon:~$ ls
documents dotfiles downloads initrd.img insync Insync.bak iso music shares tmp virtualbox vmlinuz wallpapers workspace
frank@spoon:~$
这是我的 /root 文件夹的列表。initrd.img.8579 到底是什么?
frank@spoon:/$ ll
total 96
drwxr-xr-x 23 root root 4096 Mar 19 23:13 ./
drwxr-xr-x 23 root root 4096 Mar 19 23:13 ../
drwxr-xr-x 2 root root 4096 Mar 19 21:48 bin/
drwxr-xr-x 3 root root 4096 Mar 20 13:36 boot/
drwxr-xr-x 17 root root 4340 Mar 20 13:30 dev/
drwxr-xr-x 140 root root 12288 Mar 20 13:30 etc/
drwxr-xr-x 3 root root 4096 Jan 22 20:43 home/
lrwxrwxrwx 1 root root 33 Mar 3 11:10 initrd.img.8579 -> /boot/initrd.img-3.2.0-38-generic
lrwxrwxrwx 1 root root 33 Jan 30 21:43 initrd.img.old -> /boot/initrd.img-3.2.0-36-generic
drwxr-xr-x 22 root root 4096 Mar 19 23:12 lib/
drwxr-xr-x 2 root root 4096 Jan 27 13:08 lib64/
drwx------ 2 root root 16384 Jan 22 20:36 lost+found/
drwxr-xr-x 3 root root 4096 Jan 22 20:37 media/
drwxr-xr-x 4 root root 4096 Mar 4 19:36 mnt/
drwxr-xr-x 2 root root 4096 Jan 22 20:36 opt/
dr-xr-xr-x 131 root root 0 Mar 20 13:30 proc/
drwx------ 9 root root 4096 Mar 20 13:03 root/
drwxr-xr-x 22 root root 780 Mar 20 13:32 run/
drwxr-xr-x 2 root root 4096 Mar 19 23:12 sbin/
drwxr-xr-x 2 root root 4096 Mar 5 2012 selinux/
drwxr-xr-x 3 root root 4096 Mar 4 20:02 srv/
drwxr-xr-x 13 root root 0 Mar 20 13:30 sys/
drwxrwxrwt 15 root root 4096 Mar 20 13:36 tmp/
drwxr-xr-x 11 root root 4096 Mar 4 20:01 usr/
drwxr-xr-x 12 root root 4096 Mar 20 13:15 var/
lrwxrwxrwx 1 root root 29 Mar 3 11:10 vmlinuz -> boot/vmlinuz-3.2.0-38-generic
lrwxrwxrwx 1 root root 29 Jan 30 21:43 vmlinuz.old -> boot/vmlinuz-3.2.0-36-generic
正如我所说,这非常非常奇怪。我不知道该怎么办了,所以我在 stackoverflow 上写了这个问题。感谢您的帮助,避免了我重新安装整个系统,这会花一段时间。
多谢
答案1
所以我通过从中删除 Debian 控制文件来解决这个问题/var/lib/dpkg/信息/
已删除的文件
- linux-image-3.2.0-39-通用。*
- linux-通用.*
- initramfs 工具。*
删除文件后,我只是做了能力升级再次,它正如预期的那样工作。