为什么在进行部分 dist-upgrade 之后,我不能再通过 apt-get 安装(卸载)软件包?

为什么在进行部分 dist-upgrade 之后,我不能再通过 apt-get 安装(卸载)软件包?

我(愚蠢地)运行了sudo apt-get dist-upgrade,部分成功了,但现在每次我尝试(卸载)安装包时都会得到类似这样的输出:

例如,这是的输出sudo apt-get autoremove --purge postgres*

Removing linux-image-extra-3.13.0-43-generic (3.13.0-43.72) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.13.0-43-generic /boot/vmlinuz-3.13.0-43-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.13.0-43-generic /boot/vmlinuz-3.13.0-43-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.13.0-43-generic /boot/vmlinuz-3.13.0-43-generic
update-initramfs: Generating /boot/initrd.img-3.13.0-43-generic
W: mdadm: the array /dev/md/monolith:0 with UUID 826ef9b8:1c282186:82586683:e0b960b3
W: mdadm: is currently active, but it is not listed in mdadm.conf. if
W: mdadm: it is needed for boot, then YOUR SYSTEM IS NOW UNBOOTABLE!
W: mdadm: please inspect the output of /usr/share/mdadm/mkconf, compare
W: mdadm: it to /etc/mdadm/mdadm.conf, and make the necessary changes.
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.13.0-43-generic /boot/vmlinuz-3.13.0-43-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.13.0-43-generic /boot/vmlinuz-3.13.0-43-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.13.0-43-generic /boot/vmlinuz-3.13.0-43-generic
/usr/sbin/grub-mkconfig: 38: /etc/default/grub: function: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-extra-3.13.0-43-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-3.13.0-43-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

以下是 的输出/usr/share/mdadm/mkconf

# mdadm.conf
#
# Please refer to mdadm.conf(5) for information about this file.
#

# by default (built-in), scan all partitions (/proc/partitions) and all
# containers for MD superblocks. alternatively, specify devices to scan, using
# wildcards if desired.
#DEVICE partitions containers

# auto-create devices with Debian standard permissions
CREATE owner=root group=disk mode=0660 auto=yes

# automatically tag new arrays as belonging to the local system
HOMEHOST <system>

# instruct the monitoring daemon where to send mail alerts
MAILADDR root

# definitions of existing MD arrays

下面是输出/etc/mdadm/mdadm.conf

# mdadm.conf
#
# Please refer to mdadm.conf(5) for information about this file.
#

# by default (built-in), scan all partitions (/proc/partitions) and all
# containers for MD superblocks. alternatively, specify devices to scan, using
# wildcards if desired.
#DEVICE partitions containers

# auto-create devices with Debian standard permissions
CREATE owner=root group=disk mode=0660 auto=yes

# automatically tag new arrays as belonging to the local system
HOMEHOST <system>

# instruct the monitoring daemon where to send mail alerts
MAILADDR root

# definitions of existing MD arrays
ARRAY /dev/md/0 metadata=1.2 UUID=c13ebb40:55db4a69:108822c5:5ee02f0b name=htpc:0

# This file was auto-generated on Thu, 11 Jun 2015 00:15:47 +0200
# by mkconf $Id$

我的下一步该怎么做?

编辑:值得注意的是,我重新启动没有问题,因为我没有启动到 RAID。

答案1

跑步

cp /usr/share/grub/default/grub /etc/default/grub
update-grub
sudo apt-get -f install

似乎已经解决了这个问题。我仍然不太清楚为什么事情会变得这么糟糕,但希望这能拯救其他人...

相关内容