我在论坛上多次看到过此错误,但我的问题出现在运行建议的命令时。运行时sudo apt-get install
出现错误E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
。然后,我运行命令sudo dpkg --configure -a
,命令运行但无限期挂起。我认为这是由于某些 virtualbox 安装造成的。我尝试从中删除文件,dkpg
但rm
似乎没有帮助。建议命令的输出是
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libopenshot-audio6 libopenshot17 libsdl-ttf2.0-0 libvpx5
linux-headers-5.0.0-37 linux-headers-5.0.0-37-generic
linux-image-5.0.0-37-generic linux-modules-5.0.0-37-generic
linux-modules-extra-5.0.0-37-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 14 not upgraded.
27 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up systemd-sysv (242-7ubuntu3.9) ...
Setting up libfreerdp2-2:amd64 (2.1.1+dfsg1-0ubuntu0.19.10.1) ...
Setting up libnss-systemd:amd64 (242-7ubuntu3.9) ...
Setting up libisc1100:amd64 (1:9.11.5.P4+dfsg-5.1ubuntu2.2) ...
Setting up thunderbird-locale-en (1:68.8.0+build2-0ubuntu0.19.10.2) ...
Setting up apport (2.20.11-0ubuntu8.9) ...
apport-autoreport.service is a disabled or a static unit, not starting it.
Setting up thunderbird-locale-en-us (1:68.8.0+build2-0ubuntu0.19.10.2) ...
Setting up thunderbird-gnome-support (1:68.8.0+build2-0ubuntu0.19.10.2) ...
Setting up apport-gtk (2.20.11-0ubuntu8.9) ...
Setting up libpam-systemd:amd64 (242-7ubuntu3.9) ...
Setting up libisccc161:amd64 (1:9.11.5.P4+dfsg-5.1ubuntu2.2) ...
Setting up virtualbox-dkms (6.0.14-dfsg-1) ...
Removing old virtualbox-6.0.14 DKMS files...
-------- Uninstall Beginning --------
Module: virtualbox
Version: 6.0.14
Kernel: 5.3.0-51-generic (x86_64)
-------------------------------------
Status: Before uninstall, this module version was ACTIVE on this kernel.
vboxdrv.ko:
- Uninstallation
- Deleting from: /lib/modules/5.3.0-51-generic/updates/dkms/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.
vboxnetadp.ko:
- Uninstallation
- Deleting from: /lib/modules/5.3.0-51-generic/updates/dkms/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.
vboxnetflt.ko:
- Uninstallation
- Deleting from: /lib/modules/5.3.0-51-generic/updates/dkms/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.
vboxpci.ko:
- Uninstallation
- Deleting from: /lib/modules/5.3.0-51-generic/updates/dkms/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.
depmod...
DKMS: uninstall completed.
------------------------------
Deleting module version: 6.0.14
completely from the DKMS tree.
------------------------------
Done.
Loading new virtualbox-6.0.14 DKMS files...
Building for 5.3.0-51-generic
Building initial module for 5.3.0-51-generic
Secure Boot not enabled on this system.
Done.
vboxdrv.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/5.3.0-51-generic/updates/dkms/
vboxnetadp.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/5.3.0-51-generic/updates/dkms/
vboxnetflt.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/5.3.0-51-generic/updates/dkms/
vboxpci.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/5.3.0-51-generic/updates/dkms/
depmod...
一旦终端到达,depmod...
它就会无限期挂起。我已经让它闲置了几个小时。有什么建议吗?运行 Ubuntu 19.10。
根据请求,命令的输出dpkg -l | egrep -v '^ii|rc'
是
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
+++-===========================================================-===========================================================-============-===============================================================================
iU aptdaemon 1.1.1+bzr982-0ubuntu28.2 all transaction based package management service
iU bind9-host 1:9.11.5.P4+dfsg-5.1ubuntu2.2 amd64 DNS lookup utility (deprecated)
iU ca-certificates 20190110ubuntu0.19.10.1 all Common CA certificates
it dbus 1.12.14-1ubuntu2 amd64 simple interprocess messaging system (daemon and utilities)
it desktop-file-utils 0.24-1ubuntu1 amd64 Utilities for .desktop files
iU dnsutils 1:9.11.5.P4+dfsg-5.1ubuntu2.2 amd64 Clients provided with BIND
it gnome-menus 3.32.0-1ubuntu1 amd64 GNOME implementation of the freedesktop menu specification
it hicolor-icon-theme 0.17-2 all default fallback theme for FreeDesktop.org icon themes
it initramfs-tools 0.133ubuntu10 all generic modular initramfs generator (automation)
iU libbind9-161:amd64 1:9.11.5.P4+dfsg-5.1ubuntu2.2 amd64 BIND9 Shared Library used by BIND
it libc-bin 2.30-0ubuntu2.1 amd64 GNU C Library: Binaries
iU libdns-export1104 1:9.11.5.P4+dfsg-5.1ubuntu2.2 amd64 Exported DNS Shared Library
iU libdns1104:amd64 1:9.11.5.P4+dfsg-5.1ubuntu2.2 amd64 DNS Shared Library used by BIND
iU libfreerdp-client2-2:amd64 2.1.1+dfsg1-0ubuntu0.19.10.1 amd64 Free Remote Desktop Protocol library (client library)
iU libirs161:amd64 1:9.11.5.P4+dfsg-5.1ubuntu2.2 amd64 DNS Shared Library used by BIND
iU libisccfg163:amd64 1:9.11.5.P4+dfsg-5.1ubuntu2.2 amd64 Config File Handling Library used by BIND
it man-db 2.8.7-3 amd64 on-line manual pager
it mime-support 3.63ubuntu1 all MIME files 'mime.types' & 'mailcap', and support programs
iU openssl 1.1.1c-1ubuntu4.1 amd64 Secure Sockets Layer toolkit - cryptographic utility
iU python3-aptdaemon 1.1.1+bzr982-0ubuntu28.2 all Python 3 module for the server and client of aptdaemon
iU python3-aptdaemon.gtk3widgets 1.1.1+bzr982-0ubuntu28.2 all Python 3 GTK+ 3 widgets to run an aptdaemon client
it shared-mime-info 1.10-1 amd64 FreeDesktop.org shared MIME database and spec
iU virtualbox 6.0.14-dfsg-1 amd64 x86 virtualization solution - base binaries
iU virtualbox-qt 6.0.14-dfsg-1 amd64 x86 virtualization solution - Qt based user interface
答案1
哦,请备份你的重要数据。
wget -c http://mirrors.kernel.org/ubuntu/pool/main/i/initramfs-tools/initramfs-tools_0.133ubuntu10_all.deb
并尝试使用
sudo dpkg -i initramfs-tools_0.133ubuntu10_all.deb
你问题的这部分我不明白。
我尝试使用 rm 从 dkpg 中删除文件
sudo dpkg --configure -a && sudo apt -f install
只有这样才没有错误。
sudo apt update && sudo apt full-upgrade
答案2
您的文件似乎丢失了。
这是我尝试过的解决方案:
您必须安装initramfs-tools
deb 包,
sudo apt-get update
sudo apt-get install initramfs-tools
并尝试
sudo apt updgrade
现在该问题应该已经解决了。
答案3
我解决了。首先删除软件包更新
cd /var/lib/dpkg/updates
sudo rm *
然后你应该更新软件包并删除不再使用的
sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoremove
祝你好运!鸣谢:https://brandviser.com.au/how-to-fix-dpkg-was-interrupted-error-linux/