全新安装 (Ubuntu 16.04 LTS) 我无法通过apt. 我可以运行得apt update很好,但如果我遵循其中一个apt upgrade或apt dist-upgrade它总是(我在无数次重新启动后尝试这样做,以及从恢复模式)会导致:
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
Run Code Online (Sandbox Code Playgroud)
如果我运行它,它总是执行以下操作并且无限期挂起:
Setting up grub-efi-amd64 (2.02~beta2-36ubuntu3.12) ...
Installing for x86_64-efi platform.
Installation finished. No error reported.
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.10.0-35-generic
Found initrd image: /boot/initrd.img-4.10.0-35-generic
Found linux image: /boot/vmlinuz-4.10.0-28-generic
Found initrd image: /boot/initrd.img-4.10.0-28-generic
Run Code Online (Sandbox Code Playgroud)
uname -r显示它正在运行4.10.0-35-generic,所以我可以很好地删除它,4.10.0-28-generic因为它总是挂在那里,但我无法清除它,因为这只会导致apt purge当它到达时挂起Found initrd image: /boot/initrd.img-4.10.0-28-generic。
我已经尝试了以下所有可能的排序但没有成功
sudo dpkg --configure -a
sudo apt install -f
sudo apt clean
sudo apt update
sudo apt upgrade|dist-upgrade|full-upgrade
Run Code Online (Sandbox Code Playgroud)
这是全新安装,因此我不担心任何“核”选项会导致数据丢失(即我没有数据丢失)。我尝试过使用启动修复,但它从未完成(它说可能需要几分钟,但我让它运行了几个小时)。
我意识到这个问题与E: dpkg was Interrupted... run 'sudo dpkg --configure -a'和dpkg --configure -a 在找到 initrd 映像时挂起,但没有一个答案有帮助。
grub 更新期间出现 30_os-prober 挂起的问题。我完全忘记了问题是什么。
30_uefi-firmware 也有一个可以在此处修复的问题 - https://askubuntu.com/a/938472/694267。
暂时删除两者上的执行标志即可完成配置。
sudo chmod -x /etc/grub.d/30_os-prober
sudo chmod -x /etc/grub.d/30_uefi-firmware
然后运行sudo dpkg --configure -a
如果您想要 grub 中的系统设置条目,请修复 30_uefi-firmware,然后重新启用执行
sudo chmod +x /etc/grub.d/30_uefi-firmware
然后运行sudo update-grub
| 归档时间: |
|
| 查看次数: |
959 次 |
| 最近记录: |