这个/ usr / bin / dpkg返回错误|| ubuntu-16.04,64bit

我正在尝试安装htop,但是由于未满足的依赖性而失败了。 试过sudo apt-get -f install ,但它没有解决问题。

试过sudo apt cleansudo apt updatesudo apt upgrade ,没有运气。 试图删除dpkg,没有运气。

之前它显示, Could not get lock /var/lib/dpkg/lock以便我已将其删除,现在它在安装时显示以下错误。

 Sub-process /usr/bin/dpkg returned an error code (1) ik@ik-ThinkPad-T440p:~$ sudo apt install htop Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: linux-image-extra-4.4.0-64-generic : Depends: linux-image-4.4.0-64-generic but it is not going to be installed linux-image-generic : Depends: linux-image-4.4.0-64-generic but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). ik@ik-ThinkPad-T440p:~$ ik@ik-ThinkPad-T440p:~$ sudo apt-get -f install Reading package lists... Done Building dependency tree Reading state information... Done Correcting dependencies... Done The following packages were automatically installed and are no longer required: geoip-database-extra javascript-common libc-ares2 libjs-openlayers libnl-route-3-200 libqgsttools-p1 libqt5multimedia5-plugins libqt5multimediawidgets5 libsmi2ldbl libwireshark-data libwireshark6 libwiretap5 libwsutil6 linux-headers-4.4.0-21 linux-headers-4.4.0-21-generic linux-headers-4.4.0-59 linux-headers-4.4.0-59-generic linux-image-4.4.0-21-generic linux-image-4.4.0-59-generic linux-image-extra-4.4.0-21-generic linux-image-extra-4.4.0-59-generic wireshark-common Use 'sudo apt autoremove' to remove them. The following additional packages will be installed: linux-image-4.4.0-64-generic Suggested packages: fdutils linux-doc-4.4.0 | linux-source-4.4.0 linux-tools The following NEW packages will be installed: linux-image-4.4.0-64-generic 0 upgraded, 1 newly installed, 0 to remove and 89 not upgraded. 6 not fully installed or removed. Need to get 21.8 MB of archives. After this operation, 66.4 MB of additional disk space will be used. Do you want to continue? [Y/n] Y Get:1 http://mirrors.nayatel.com/ubuntu xenial-updates/main amd64 linux-image-4.4.0-64-generic amd64 4.4.0-64.85 [21.8 MB] Fetched 21.8 MB in 1min 5s (335 kB/s) debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable (Reading database ... 326141 files and directories currently installed.) Preparing to unpack .../linux-image-4.4.0-64-generic_4.4.0-64.85_amd64.deb ... debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable dpkg: error processing archive /var/cache/apt/archives/linux-image-4.4.0-64-generic_4.4.0-64.85_amd64.deb (--unpack): subprocess new pre-installation script returned error exit status 1 Examining /etc/kernel/postrm.d . run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-64-generic /boot/vmlinuz-4.4.0-64-generic run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-64-generic /boot/vmlinuz-4.4.0-64-generic Errors were encountered while processing: /var/cache/apt/archives/linux-image-4.4.0-64-generic_4.4.0-64.85_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1) 

这些是命令的输出,请帮我解决这个问题。 p:〜$ df -H文件系统大小已使用可用使用%安装在udev上4.1G 0 4.1G 0%/ dev tmpfs 805M 19M 787M 3%/运行/ dev / sda7 293G 14G 264G 5%/ tmpfs 4.1G 201M 3.9G 5 %/ dev / shm tmpfs 5.3M 4.1k 5.3M 1%/运行/锁定tmpfs 4.1G 0 4.1G 0%/ sys / fs / cgroup / dev / loop0 62M 62M 0 100%/ snap / notes / 4 / dev / loop3 79M 79M 0 100%/ snap / core / 1337 / dev / loop2 80M 80M 0 100%/ snap / core / 1264 / dev / loop1 80M 80M 0 100%/ snap / core / 1240 tmpfs 805M 62k 805M 1%/ run /用户/ 1000

我自己解决了这个问题。

删除所有现有的软件包,如下所示注意:在执行此操作之前,请关闭所有选项卡和其他工作表,因为我们不知道哪个进程阻碍了解决方案。

第1名:sudo apt autoremove

然后,sudo apt-get clean然后,sudo apt-get -f install然后,sudo apt-get update然后,sudo apt-get upgrade

你完成了修复。