全新安装 Ubuntu 16.04.4 LTS 并执行 apt-get 升级导致系统无法运行

全新安装 Ubuntu 16.04.4 LTS 并执行 apt-get 升级导致系统无法运行

我刚刚下载了最新的 Ubuntu 16.04.4 LTS(服务器)ISO,将其安装在KVM VM上,启动VM,执行了标准操作apt-get upgrade,但在升级完成之前,它就开始抱怨某些二进制文件不再起作用。重新启动VM会导致服务器无法正常工作。

昨天,我使用的是稍旧版本的 16.04 LTS,结果相同,只是升级包更多。我认为这可以通过更新的 ISO 来解决。我猜想,这个论坛上缺少“极端紧急”帖子意味着它只是我的 apt 源:ca.archive.ubuntu.com。

作为参考,这是我从 apt-get 获得的输出,就在它破坏整个系统时:

ernied@postgres-replicate:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  apparmor apt apt-transport-https apt-utils curl dpkg friendly-recovery grub-legacy-ec2 isc-dhcp-client
  isc-dhcp-common libapparmor-perl libapparmor1 libapt-inst2.0 libapt-pkg5.0 libcurl3-gnutls libgcrypt20
  libpam-systemd libpq5 libsystemd0 libudev1 postgresql-9.5 postgresql-client-9.5 postgresql-contrib-9.5
  postgresql-doc-9.5 systemd systemd-sysv udev update-notifier-common
28 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 17.2 MB of archives.
After this operation, 157 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ca.archive.ubuntu.com/ubuntu xenial-updates/main amd64 dpkg amd64 1.18.4ubuntu1.4 [2,088 kB]
Get:2 http://ca.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libapt-pkg5.0 amd64 1.2.26 [706 kB]
Get:3 http://ca.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libapt-inst2.0 amd64 1.2.26 [55.4 kB]
Get:4 http://ca.archive.ubuntu.com/ubuntu xenial-updates/main amd64 apt amd64 1.2.26 [1,043 kB]
Get:5 http://ca.archive.ubuntu.com/ubuntu xenial-updates/main amd64 apt-utils amd64 1.2.26 [197 kB]
Get:6 http://ca.archive.ubuntu.com/ubuntu xenial-updates/main amd64 systemd-sysv amd64 229-4ubuntu21.2 [11.9 kB]
Get:7 http://ca.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libpam-systemd amd64 229-4ubuntu21.2 [115 kB]
Get:8 http://ca.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libsystemd0 amd64 229-4ubuntu21.2 [205 kB]
Get:9 http://ca.archive.ubuntu.com/ubuntu xenial-updates/main amd64 systemd amd64 229-4ubuntu21.2 [3,634 kB]
Get:10 http://ca.archive.ubuntu.com/ubuntu xenial-updates/main amd64 udev amd64 229-4ubuntu21.2 [993 kB]
Get:11 http://ca.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libudev1 amd64 229-4ubuntu21.2 [54.4 kB]
Get:12 http://ca.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libapparmor1 amd64 2.10.95-0ubuntu2.9 [29.9 kB]
Get:13 http://ca.archive.ubuntu.com/ubuntu xenial-updates/main amd64 update-notifier-common all 3.168.8 [164 kB]
Get:14 http://ca.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libgcrypt20 amd64 1.6.5-2ubuntu0.4 [337 kB]
Get:15 http://ca.archive.ubuntu.com/ubuntu xenial-updates/main amd64 isc-dhcp-client amd64 4.3.3-5ubuntu12.10 [224 kB]
Get:16 http://ca.archive.ubuntu.com/ubuntu xenial-updates/main amd64 isc-dhcp-common amd64 4.3.3-5ubuntu12.10 [105 kB]
Get:17 http://ca.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libapparmor-perl amd64 2.10.95-0ubuntu2.9 [31.5 kB]
Get:18 http://ca.archive.ubuntu.com/ubuntu xenial-updates/main amd64 apparmor amd64 2.10.95-0ubuntu2.9 [450 kB]
Get:19 http://ca.archive.ubuntu.com/ubuntu xenial-updates/main amd64 curl amd64 7.47.0-1ubuntu2.7 [138 kB]
Get:20 http://ca.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libcurl3-gnutls amd64 7.47.0-1ubuntu2.7 [185 kB]
Get:21 http://ca.archive.ubuntu.com/ubuntu xenial-updates/main amd64 apt-transport-https amd64 1.2.26 [26.1 kB]
Get:22 http://ca.archive.ubuntu.com/ubuntu xenial-updates/main amd64 friendly-recovery all 0.2.31ubuntu1 [9,496 B]
Get:23 http://ca.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libpq5 amd64 9.5.12-0ubuntu0.16.04 [79.0 kB]
Get:24 http://ca.archive.ubuntu.com/ubuntu xenial-updates/main amd64 postgresql-contrib-9.5 amd64 9.5.12-0ubuntu0.16.04 [448 kB]
Get:25 http://ca.archive.ubuntu.com/ubuntu xenial-updates/main amd64 postgresql-client-9.5 amd64 9.5.12-0ubuntu0.16.04 [872 kB]
Get:26 http://ca.archive.ubuntu.com/ubuntu xenial-updates/main amd64 postgresql-9.5 amd64 9.5.12-0ubuntu0.16.04 [3,010 kB]
Get:27 http://ca.archive.ubuntu.com/ubuntu xenial-updates/main amd64 postgresql-doc-9.5 all 9.5.12-0ubuntu0.16.04 [1,980 kB]
Get:28 http://ca.archive.ubuntu.com/ubuntu xenial-updates/main amd64 grub-legacy-ec2 all 17.2-35-gf576b2a2-0ubuntu1~16.04.2 [25.2 kB]
Fetched 17.2 MB in 3s (4,401 kB/s)     
Preconfiguring packages ...
(Reading database ... 62217 files and directories currently installed.)
Preparing to unpack .../dpkg_1.18.4ubuntu1.4_amd64.deb ...
Unpacking dpkg (1.18.4ubuntu1.4) over (1.18.4ubuntu1.3) ...
Setting up dpkg (1.18.4ubuntu1.4) ...
Processing triggers for man-db (2.7.5-1) ...
(Reading database ... 62217 files and directories currently installed.)
Preparing to unpack .../libapt-pkg5.0_1.2.26_amd64.deb ...
Unpacking libapt-pkg5.0:amd64 (1.2.26) over (1.2.25) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Setting up libapt-pkg5.0:amd64 (1.2.26) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
(Reading database ... 62217 files and directories currently installed.)
Preparing to unpack .../libapt-inst2.0_1.2.26_amd64.deb ...
Unpacking libapt-inst2.0:amd64 (1.2.26) over (1.2.25) ...
Preparing to unpack .../archives/apt_1.2.26_amd64.deb ...
Unpacking apt (1.2.26) over (1.2.25) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up apt (1.2.26) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
(Reading database ... 62217 files and directories currently installed.)
Preparing to unpack .../apt-utils_1.2.26_amd64.deb ...
Unpacking apt-utils (1.2.26) over (1.2.25) ...
Preparing to unpack .../systemd-sysv_229-4ubuntu21.2_amd64.deb ...
Unpacking systemd-sysv (229-4ubuntu21.2) over (229-4ubuntu21.1) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up systemd-sysv (229-4ubuntu21.2) ...
(Reading database ... 62217 files and directories currently installed.)
Preparing to unpack .../libpam-systemd_229-4ubuntu21.2_amd64.deb ...
Unpacking libpam-systemd:amd64 (229-4ubuntu21.2) over (229-4ubuntu21.1) ...
Preparing to unpack .../libsystemd0_229-4ubuntu21.2_amd64.deb ...
Unpacking libsystemd0:amd64 (229-4ubuntu21.2) over (229-4ubuntu21.1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Setting up libsystemd0:amd64 (229-4ubuntu21.2) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
(Reading database ... 62217 files and directories currently installed.)
Preparing to unpack .../systemd_229-4ubuntu21.2_amd64.deb ...
Unpacking systemd (229-4ubuntu21.2) over (229-4ubuntu21.1) ...
Processing triggers for dbus (1.10.6-1ubuntu3.3) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up systemd (229-4ubuntu21.2) ...
addgroup: The group `systemd-journal' already exists as a system group. Exiting.
(Reading database ... 62217 files and directories currently installed.)
Preparing to unpack .../udev_229-4ubuntu21.2_amd64.deb ...
Unpacking udev (229-4ubuntu21.2) over (229-4ubuntu21.1) ...
Preparing to unpack .../libudev1_229-4ubuntu21.2_amd64.deb ...
Unpacking libudev1:amd64 (229-4ubuntu21.2) over (229-4ubuntu21.1) ...
Processing triggers for systemd (229-4ubuntu21.2) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Setting up libudev1:amd64 (229-4ubuntu21.2) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
(Reading database ... 62217 files and directories currently installed.)
Preparing to unpack .../libapparmor1_2.10.95-0ubuntu2.9_amd64.deb ...
Unpacking libapparmor1:amd64 (2.10.95-0ubuntu2.9) over (2.10.95-0ubuntu2.8) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Setting up libapparmor1:amd64 (2.10.95-0ubuntu2.9) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
(Reading database ... 62217 files and directories currently installed.)
Preparing to unpack .../update-notifier-common_3.168.8_all.deb ...
Unpacking update-notifier-common (3.168.8) over (3.168.7) ...
Preparing to unpack .../libgcrypt20_1.6.5-2ubuntu0.4_amd64.deb ...
Unpacking libgcrypt20:amd64 (1.6.5-2ubuntu0.4) over (1.6.5-2ubuntu0.3) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Setting up libgcrypt20:amd64 (1.6.5-2ubuntu0.4) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
(Reading database ... 62217 files and directories currently installed.)
Preparing to unpack .../isc-dhcp-client_4.3.3-5ubuntu12.10_amd64.deb ...
Unpacking isc-dhcp-client (4.3.3-5ubuntu12.10) over (4.3.3-5ubuntu12.7) ...
Preparing to unpack .../isc-dhcp-common_4.3.3-5ubuntu12.10_amd64.deb ...
Unpacking isc-dhcp-common (4.3.3-5ubuntu12.10) over (4.3.3-5ubuntu12.7) ...
Preparing to unpack .../libapparmor-perl_2.10.95-0ubuntu2.9_amd64.deb ...
Unpacking libapparmor-perl (2.10.95-0ubuntu2.9) over (2.10.95-0ubuntu2.8) ...
Preparing to unpack .../apparmor_2.10.95-0ubuntu2.9_amd64.deb ...
Unpacking apparmor (2.10.95-0ubuntu2.9) over (2.10.95-0ubuntu2.8) ...
Preparing to unpack .../curl_7.47.0-1ubuntu2.7_amd64.deb ...
Unpacking curl (7.47.0-1ubuntu2.7) over (7.47.0-1ubuntu2.6) ...
Preparing to unpack .../libcurl3-gnutls_7.47.0-1ubuntu2.7_amd64.deb ...
Unpacking libcurl3-gnutls:amd64 (7.47.0-1ubuntu2.7) over (7.47.0-1ubuntu2.6) ...
Preparing to unpack .../apt-transport-https_1.2.26_amd64.deb ...
Unpacking apt-transport-https (1.2.26) over (1.2.25) ...
Preparing to unpack .../friendly-recovery_0.2.31ubuntu1_all.deb ...
Unpacking friendly-recovery (0.2.31ubuntu1) over (0.2.31) ...
Preparing to unpack .../libpq5_9.5.12-0ubuntu0.16.04_amd64.deb ...
Unpacking libpq5:amd64 (9.5.12-0ubuntu0.16.04) over (9.5.11-0ubuntu0.16.04) ...
Preparing to unpack .../postgresql-contrib-9.5_9.5.12-0ubuntu0.16.04_amd64.deb ...
Unpacking postgresql-contrib-9.5 (9.5.12-0ubuntu0.16.04) over (9.5.11-0ubuntu0.16.04) ...
Preparing to unpack .../postgresql-client-9.5_9.5.12-0ubuntu0.16.04_amd64.deb ...
Unpacking postgresql-client-9.5 (9.5.12-0ubuntu0.16.04) over (9.5.11-0ubuntu0.16.04) ...
Preparing to unpack .../postgresql-9.5_9.5.12-0ubuntu0.16.04_amd64.deb ...
Unpacking postgresql-9.5 (9.5.12-0ubuntu0.16.04) over (9.5.11-0ubuntu0.16.04) ...
Preparing to unpack .../postgresql-doc-9.5_9.5.12-0ubuntu0.16.04_all.deb ...
Unpacking postgresql-doc-9.5 (9.5.12-0ubuntu0.16.04) over (9.5.11-0ubuntu0.16.04) ...
Preparing to unpack .../grub-legacy-ec2_17.2-35-gf576b2a2-0ubuntu1~16.04.2_all.deb ...
Leaving 'diversion of /usr/sbin/grub-set-default to /usr/sbin/grub-set-default.real by grub-legacy-ec2'
Unpacking grub-legacy-ec2 (17.2-35-gf576b2a2-0ubuntu1~16.04.2) over (17.1-46-g7acc9e68-0ubuntu1~16.04.1) ...
dpkg: warning: unable to delete old directory '/etc/kernel/kernel/postrm.d': Directory not empty
dpkg: warning: unable to delete old directory '/etc/kernel/kernel/postinst.d': Directory not empty
dpkg: warning: unable to delete old directory '/etc/kernel/kernel': Directory not empty
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for systemd (229-4ubuntu21.2) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Processing triggers for postgresql-common (173ubuntu0.1) ...
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
Removing obsolete dictionary files:
Setting up libapt-inst2.0:amd64 (1.2.26) ...
Setting up apt-utils (1.2.26) ...
Setting up libpam-systemd:amd64 (229-4ubuntu21.2) ...
Setting up udev (229-4ubuntu21.2) ...
addgroup: The group `input' already exists as a system group. Exiting.
update-initramfs: deferring update (trigger activated)
Setting up update-notifier-common (3.168.8) ...
Setting up isc-dhcp-client (4.3.3-5ubuntu12.10) ...
Setting up isc-dhcp-common (4.3.3-5ubuntu12.10) ...
Setting up libapparmor-perl (2.10.95-0ubuntu2.9) ...
Setting up apparmor (2.10.95-0ubuntu2.9) ...
Installing new version of config file /etc/apparmor.d/abstractions/base ...
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd
Setting up libcurl3-gnutls:amd64 (7.47.0-1ubuntu2.7) ...
Setting up curl (7.47.0-1ubuntu2.7) ...
Setting up apt-transport-https (1.2.26) ...
Setting up friendly-recovery (0.2.31ubuntu1) ...
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.0-116-generic
Found initrd image: /boot/initrd.img-4.4.0-116-generic
done
Setting up libpq5:amd64 (9.5.12-0ubuntu0.16.04) ...
Setting up postgresql-client-9.5 (9.5.12-0ubuntu0.16.04) ...
Setting up postgresql-9.5 (9.5.12-0ubuntu0.16.04) ...
Setting up postgresql-contrib-9.5 (9.5.12-0ubuntu0.16.04) ...
Setting up postgresql-doc-9.5 (9.5.12-0ubuntu0.16.04) ...
Setting up grub-legacy-ec2 (17.2-35-gf576b2a2-0ubuntu1~16.04.2) ...
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /vmlinuz-4.4.0-116-generic
Found kernel: /vmlinuz-4.4.0-116-generic
Updating /boot/grub/menu.lst ... done

Processing triggers for libc-bin (2.23-0ubuntu10) ...
Processing triggers for initramfs-tools (0.122ubuntu8.10) ...
update-initramfs: Generating /boot/initrd.img-4.4.0-116-generic
modinfo: ERROR: could not get modinfo from 'ff_memless': Exec format error
modinfo: ERROR: could not get modinfo from 'max8998': Exec format error
modinfo: ERROR: could not get modinfo from 'lp8788_ldo': Exec format error
modinfo: ERROR: could not get modinfo from 'lp8755': Exec format error
modinfo: ERROR: could not get modinfo from 'virtio_scsi': Exec format error
modinfo: ERROR: could not get modinfo from 'iscsi_boot_sysfs': Exec format error
modinfo: ERROR: could not get modinfo from 'am53c974': Exec format error
modinfo: ERROR: could not get modinfo from 'pd': Exec format error
modinfo: ERROR: could not get modinfo from 'brd': Exec format error
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
depmod: ERROR: failed to load symbols from /var/tmp/mkinitramfs_Sx8uX6/lib/modules/4.4.0-116-generic/kernel/drivers/regulator/lp8788-ldo.ko: Exec format error
depmod: ERROR: failed to load symbols from /var/tmp/mkinitramfs_Sx8uX6/lib/modules/4.4.0-116-generic/kernel/drivers/regulator/lp8755.ko: Exec format error
depmod: ERROR: failed to load symbols from /var/tmp/mkinitramfs_Sx8uX6/lib/modules/4.4.0-116-generic/kernel/drivers/regulator/max8998.ko: Exec format error
depmod: ERROR: failed to load symbols from /var/tmp/mkinitramfs_Sx8uX6/lib/modules/4.4.0-116-generic/kernel/drivers/block/brd.ko: Exec format error
depmod: ERROR: failed to load symbols from /var/tmp/mkinitramfs_Sx8uX6/lib/modules/4.4.0-116-generic/kernel/drivers/scsi/iscsi_boot_sysfs.ko: Exec format error
depmod: ERROR: failed to load symbols from /var/tmp/mkinitramfs_Sx8uX6/lib/modules/4.4.0-116-generic/kernel/drivers/scsi/am53c974.ko: Exec format error
depmod: ERROR: failed to load symbols from /var/tmp/mkinitramfs_Sx8uX6/lib/modules/4.4.0-116-generic/kernel/drivers/scsi/virtio_scsi.ko: Exec format error
depmod: ERROR: failed to load symbols from /var/tmp/mkinitramfs_Sx8uX6/lib/modules/4.4.0-116-generic/kernel/drivers/input/ff-memless.ko: Exec format error
depmod: ERROR: failed to load symbols from /var/tmp/mkinitramfs_Sx8uX6/lib/modules/4.4.0-116-generic/kernel/drivers/block/paride/pd.ko: Exec format error

更新

我刚刚确认,使用美国镜像 us.archive.ubuntu.com 时也存在类似的问题:

Processing triggers for libc-bin (2.23-0ubuntu10) ...
Processing triggers for initramfs-tools (0.122ubuntu8.10) ...
update-initramfs: Generating /boot/initrd.img-4.4.0-116-generic
modinfo: ERROR: could not get modinfo from 'virtio_scsi': Exec format error
modinfo: ERROR: could not get modinfo from 'seed': Exec format error
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
depmod: ERROR: failed to load symbols from /var/tmp/mkinitramfs_UT0kxw/lib/modules/4.4.0-116-generic/kernel/crypto/seed.ko: Exec format error
depmod: ERROR: failed to load symbols from /var/tmp/mkinitramfs_UT0kxw/lib/modules/4.4.0-116-generic/kernel/drivers/scsi/virtio_scsi.ko: Exec format error

您可以通过下载最新的 Ubuntu 16.04.4 ISO 并使用以下选项安装来重现此错误:

  • Linux LVM
  • Postgres 数据库包
  • OpenSSH 服务器包

安装完成后,执行apt update && apt upgrade。如果您真的想看看它有多糟糕,请在升级完成后重新启动服务器。

我已经尝试过设置和未设置 LVM 的情况。

相关内容