我今天拿到了一台搭载 14.04 版本的戴尔 XPS 13 开发者版。我正尝试升级到 15.04 以解决一些触控板问题,看来我需要先升级到 14.10,然后再升级到 15.04。
当我运行升级时,它在安装进行到 3/4 时停止,并出现以下错误:
System Error: E:sub-process /usr/bin/dpkg returned an error code (1)
经过一番谷歌搜索后,我偶然发现了一个建议运行的命令dpkg --configure -a
。该命令的输出如下。
nate@nate-XPS-13-9343:~$ sudo !!
sudo dpkg --configure -a
Setting up initramfs-tools (0.103ubuntu8) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-image-3.16.0-38-generic (3.16.0-38.52) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-3.16.0-38-generic
vmlinuz(/boot/vmlinuz-3.16.0-38-generic
) points to /boot/vmlinuz-3.16.0-38-generic
(/boot/vmlinuz-3.16.0-38-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-3.16.0-38-generic.postinst line 491.
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.16.0-38-generic /boot/vmlinuz-3.16.0-38-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.16.0-38-generic /boot/vmlinuz-3.16.0-38-generic
Error! The dkms.conf for this module includes a BUILD_EXCLUSIVE directive which
does not match this kernel/arch. This indicates that it should not be built.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.16.0-38-generic /boot/vmlinuz-3.16.0-38-generic
update-initramfs: Generating /boot/initrd.img-3.16.0-38-generic
E: /usr/share/initramfs-tools/hooks/casper-memdisk failed with return 1.
update-initramfs: failed for /boot/initrd.img-3.16.0-38-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.16.0-38-generic.postinst line 1025.
dpkg: error processing package linux-image-3.16.0-38-generic (--configure):
subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-extra-3.16.0-38-generic:
linux-image-extra-3.16.0-38-generic depends on linux-image-3.16.0-38-generic; however:
Package linux-image-3.16.0-38-generic is not configured yet.
dpkg: error processing package linux-image-extra-3.16.0-38-generic (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-generic:
linux-image-generic depends on linux-image-3.16.0-38-generic; however:
Package linux-image-3.16.0-38-generic is not configured yet.
linux-image-generic depends on linux-image-extra-3.16.0-38-generic; however:
Package linux-image-extra-3.16.0-38-generic is not configured yet.
dpkg: error processing package linux-image-generic (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic:
linux-generic depends on linux-image-generic (= 3.16.0.38.39); however:
Package linux-image-generic is not configured yet.
dpkg: error processing package linux-generic (--configure):
dependency problems - leaving unconfigured
Processing triggers for initramfs-tools (0.103ubuntu8) ...
update-initramfs: Generating /boot/initrd.img-3.13.0-53-generic
E: /usr/share/initramfs-tools/hooks/casper-memdisk failed with return 1.
update-initramfs: failed for /boot/initrd.img-3.13.0-53-generic with 1.
dpkg: error processing package initramfs-tools (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
linux-image-3.16.0-38-generic
linux-image-extra-3.16.0-38-generic
linux-image-generic
linux-generic
initramfs-tools
nate@nate-XPS-13-9343:~$
上次我这样做并重新启动时,系统会挂在启动屏幕上。我最终能够进入戴尔恢复启动屏幕,然后回到正常工作的 14.04 安装。
我对 Ubuntu 底层还比较陌生。有人知道我该如何解决这个问题并升级到 14.10 或直接升级到 15.04 吗?
谢谢。
答案1
删除apt-get remove --purge
输出末尾未配置的软件包,然后linux-image-3.16.0-38-generic
重新安装它们,sudo apt-get install
例如:
sudo apt-get remove --purge linux-image-3.16.0-38-generic linux-image-extra-3.16.0-38-generic linux-image-generic linux-generic initramfs-tools
然后运行:
sudo apt-get update
sudo apt-get install --install-recommends linux-generic-lts-utopic
或者使用已删除的完整包命令:
sudo apt-get install linux-generic-lts-utopic linux-image-generic-lts-utopic linux-image-extra-generic-lts-utopic initramfs-tools
然后运行:
sudo apt-get update
sudo apt-get -f install
sudo apt-get dist-upgrade