![无法更新内核](https://linux22.com/image/982168/%E6%97%A0%E6%B3%95%E6%9B%B4%E6%96%B0%E5%86%85%E6%A0%B8.png)
我在尝试启动 Ubuntu Server 时不断收到内核恐慌(未同步。未找到 init),因此我将最新版本的 Ubuntu Server 刻录到 CD 并启动(使用选项启动到第一块磁盘)以尝试按照Ubuntu 论坛帖子。
一切顺利,直到我尝试执行sudo apt-get upgrade
并得到一堆段错误(核心转储)和其他错误,如下所示......
有什么办法可以删除这些旧内核并安装新的干净内核吗?或者这无济于事,我需要进行全新安装吗?
david@ubuntu:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be REMOVED
linux-image-extra-3.16.0-30-generic linux-image-extra-3.16.0-31-generic
linux-image-extra-3.16.0-33-generic
The following packages have been kept back:
linux-generic-lts-utopic linux-headers-generic-lts-utopic
linux-image-generic-lts-utopic
The following packages will be upgraded:
accountsservice apparmor apport apt apt-transport-https apt-utils binutils
cpp-4.8 curl deb-multimedia-keyring dkms fuse g++-4.8 gcc-4.8 gcc-4.8-base
grub-common grub-pc grub-pc-bin grub2-common initscripts isc-dhcp-client
isc-dhcp-common libaccountsservice0 libapparmor-perl libapparmor1
libapt-inst1.5 libapt-pkg4.12 libasan0 libatomic1 libcups2 libcurl3
libcurl3-gnutls libdrm2 libfuse2 libgcc-4.8-dev libgomp1 libitm1
libldap-2.4-2 libnuma1 libnvpair1 libpam-systemd libpolkit-agent-1-0
libpolkit-backend-1-0 libpolkit-gobject-1-0 libpython2.7
libpython2.7-minimal libpython2.7-stdlib libpython3.4-minimal
libpython3.4-stdlib libquadmath0 libssl1.0.0 libstdc++-4.8-dev libstdc++6
libsystemd-daemon0 libsystemd-login0 libtasn1-6 libtsan0 libudev1 libuutil1
libzfs2 libzpool2 linux-firmware linux-libc-dev openssl patch
plexmediaserver policykit-1 ppp python-pkg-resources python-requests
python-six python-urllib3 python2.7 python2.7-minimal python3-apport
python3-problem-report python3-update-manager python3.4 python3.4-minimal
rsyslog spl spl-dkms systemd-services sysv-rc sysvinit-utils udev
unattended-upgrades unrar update-manager-core wpasupplicant zfs-dkms zfs-doc
zfsutils
93 to upgrade, 0 to newly install, 3 to remove and 3 not to upgrade.
5 not fully installed or removed.
Need to get 205 MB of archives.
After this operation, 449 MB disk space will be freed.
Do you want to continue? [Y/n] y
Get:1 http://www.deb-multimedia.org/ wheezy/main deb-multimedia-keyring all des all 0.82.1ubuntu2.3 [25.5 kB]
Get:92 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/multiverse unrar amd6
[...SNIPPED...] 4 1:5.0.10-1ubuntu0.14.04.1 [117 kB]
Get:93 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main wpasupplicant am d64 2.1-0ubuntu1.3 [749 kB]
Fetched 205 MB in 1min 33s (2,198 kB/s)
Segmentation fault (core dumped)
(Reading database ... 144747 files and directories currently installed.)
Removing linux-image-extra-3.16.0-30-generic (3.16.0-30.40~14.04.1) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.16.0-30-generic / boot/vmlinuz-3.16.0-30-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.16.0-30-generic /boot/vmlinuz -3.16.0-30-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.16.0-30-generic /b oot/vmlinuz-3.16.0-30-generic
update-initramfs: Generating /boot/initrd.img-3.16.0-30-generic
Segmentation fault (core dumped)
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 139
dpkg: error processing package linux-image-extra-3.16.0-30-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-extra-3.16.0-31-generic (3.16.0-31.43~14.04.1) ...
depmod: FATAL: could not load /boot/System.map-3.16.0-31-generic: No such file o r directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.16.0-31-generic / boot/vmlinuz-3.16.0-31-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.16.0-31-generic /boot/vmlinuz -3.16.0-31-generic
/var/lib/dkms/spl/0.6.3/build/configure: line 546: 6397 Illegal instruction (core dumped) rmdir conf$$.dir 2> /dev/null
config/config.guess: line 1: 6520 Illegal instruction (core dumped) exit
/var/lib/dkms/spl/0.6.3/build/configure: line 2947: 6569 Illegal instruction (core dumped) rmdir .tst 2> /dev/null
configure: error: in `/var/lib/dkms/spl/0.6.3/build':
configure: error: C compiler cannot create executables
See `config.log' for more details
Error! Bad return status for module build on kernel: 3.16.0-31-generic (x86_64)
Consult /var/lib/dkms/spl/0.6.3/build/make.log for more information.
/var/lib/dkms/zfs/0.6.3/build/configure: line 546: 7010 Illegal instruction (core dumped) rmdir conf$$.dir 2> /dev/null
config/config.guess: line 1: 7151 Illegal instruction (core dumped) exit
/var/lib/dkms/zfs/0.6.3/build/configure: line 3119: 7200 Illegal instruction (core dumped) rmdir .tst 2> /dev/null
configure: error: in `/var/lib/dkms/zfs/0.6.3/build':
configure: error: C compiler cannot create executables
See `config.log' for more details
Error! Bad return status for module build on kernel: 3.16.0-31-generic (x86_64)
Consult /var/lib/dkms/zfs/0.6.3/build/make.log for more information.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.16.0-31-generic /boot/vmlinuz-3.16.0-31-generic
update-initramfs: Generating /boot/initrd.img-3.16.0-31-generic
grep: /boot/config-3.16.0-31-generic: No such file or directory
depmod: WARNING: could not open /tmp/mkinitramfs_p3H5nU/lib/modules/3.16.0-31-generic/modules.order: No such file or directory
depmod: WARNING: could not open /tmp/mkinitramfs_p3H5nU/lib/modules/3.16.0-31-generic/modules.builtin: No such file or directory
Segmentation fault (core dumped)
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 139
dpkg: error processing package linux-image-extra-3.16.0-31-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-extra-3.16.0-33-generic (3.16.0-33.44~14.04.1) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.16.0-33-generic /boot/vmlinuz-3.16.0-33-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.16.0-33-generic /boot/vmlinuz-3.16.0-33-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.16.0-33-generic /boot/vmlinuz-3.16.0-33-generic
update-initramfs: Generating /boot/initrd.img-3.16.0-33-generic
Segmentation fault (core dumped)
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 139
dpkg: error processing package linux-image-extra-3.16.0-33-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
linux-image-extra-3.16.0-30-generic
linux-image-extra-3.16.0-31-generic
linux-image-extra-3.16.0-33-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
您是否尝试过从以下 tty 类型执行此操作:
sudo apt-get install kernel-packages
sudo apt-get install x86_amd64-efi_ amd64-efi
sudo apt-get install aptitude
sudo aptitude x86_amd64-efi_
sudo apt-get install -f
sudo apt-get update
sudo apt-get upgrade
这样也许能很好地发挥作用。