Ubuntu解决 “Package dpkg is not configured yet.“ 问题

报错

Ubuntu系统中安装docker过程中报错

user:~# apt-get install docker
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
docker is already the newest version (1.5-2).
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up dpkg (1.21.1ubuntu2.1) ...
head: error reading 'info.bak': Is a directory
dpkg: error processing package dpkg (--configure):
 installed dpkg package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of dash:
 dash depends on dpkg (>= 1.19.1); however:
  Package dpkg is not configured yet.

dpkg: error processing package dash (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 dpkg
 dash
E: Sub-process /usr/bin/dpkg returned an error code (1)

解决办法

sudo mv /var/lib/dpkg/info/dpkg* /tmp
sudo apt install -f
sudo dpkg --configure -a

参考

https://stackoverflow.com/questions/72581436/configuring-dpkg-fails-with-error-package-dpkg-is-not-configured-yet
https://itsfoss.com/dpkg-returned-an-error-code-1

你可能感兴趣的:(Linux,ubuntu,linux,运维)