Ubuntu 12.04更新到3.8内核失败

时间:2016-02-11 10:05:54

标签: linux ubuntu ubuntu-12.04

我一直在尝试在运行Ubuntu 12.04.5 LTS的Linux服务器上更新内核。 运行uname -r会将2.6.32-042stab113.11显示为当前版本。 我运行通常的apt-get更新来获取最新的软件包。 我运行了以下命令:

apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring

这将输出以下信息,最后一行输出:

Errors were encountered while processing:
linux-image-3.8.0-44-generic
linux-image-generic-lts-raring
E: Sub-process /usr/bin/dpkg returned an error code (1)

进一步向上输出是另一个错误:

E: /usr/share/initramfs-tools/hooks/fixrtc failed with return 1.
update-initramfs: failed for /boot/initrd.img-3.8.0-44-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.8.0-44-generic.postinst line 1010.
dpkg: error processing linux-image-3.8.0-44-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
No apport report written because the error message indicates its a followup error from a previous failure.
                           dpkg: dependency problems prevent configuration of linux-image-generic-lts-raring:
 linux-image-generic-lts-raring depends on linux-image-3.8.0-44-generic; however:
  Package linux-image-3.8.0-44-generic is not configured yet.

我已经尝试运行apt-get autoclean,apt-get -f install来修复损坏的软件包。

我想知道我是否可以执行apt-get删除linux-image-3.8.0-44-generic linux-image-generic-lts-raring然后重新安装。

我应该运行apt-get upgrade。

到目前为止,我一直不愿意这样做,以免它破坏服务器并使我们的网站脱机。

有什么建议吗?

终端的完整输出:

root@213-xx-xxx-xx:/var/www/vhosts/example.com# apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring
Reading package lists... Done
Building dependency tree       
Reading state information... Done
linux-headers-generic-lts-raring is already the newest version.
linux-image-generic-lts-raring is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 176 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? Y
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = "en_GB.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Setting up linux-image-3.8.0-44-generic (3.8.0-44.66~precise1) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-3.8.0-44-generic
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.8.0-44-generic /boot/vmlinuz-3.8.0-44-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.8.0-44-generic /boot/vmlinuz-3.8.0-44-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.8.0-44-generic /boot/vmlinuz-3.8.0-44-generic
update-initramfs: Generating /boot/initrd.img-3.8.0-44-generic
E: /usr/share/initramfs-tools/hooks/fixrtc failed with return 1.
update-initramfs: failed for /boot/initrd.img-3.8.0-44-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.8.0-44-generic.postinst line 1010.
dpkg: error processing linux-image-3.8.0-44-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
No apport report written because the error message indicates its a followup error from a previous failure.
                           dpkg: dependency problems prevent configuration of linux-image-generic-lts-raring:
 linux-image-generic-lts-raring depends on linux-image-3.8.0-44-generic; however:
  Package linux-image-3.8.0-44-generic is not configured yet.
dpkg: error processing linux-image-generic-lts-raring (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-image-3.8.0-44-generic
 linux-image-generic-lts-raring
E: Sub-process /usr/bin/dpkg returned an error code (1)

2 个答案:

答案 0 :(得分:3)

尝试

sudo chmod -x /usr/share/initramfs-tools/hooks/fixrtc
建议here

。 这会禁用fixrtc挂钩,这在所有情况下都不需要。 您可以使用

撤消此步骤
sudo chmod +x /usr/share/initramfs-tools/hooks/fixrtc

答案 1 :(得分:2)

尝试以下方法:

apt-get autoclean
apt-get clean
apt-get update 
apt-get upgrade
apt-get dist-upgrade
apt-get -f install
dpkg --configure -a

这应该可以解决问题。