win10 ubuntu 安装卸载软件报错 Sub-process /usr/bin/dpkg returned an error code (1)

sudo apt-get install docker-ce=18.06.3~ce~3-0~ubuntu
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  docker-ce-cli
The following packages will be DOWNGRADED:
  docker-ce
0 upgraded, 0 newly installed, 1 downgraded, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 40.2 MB of archives.
After this operation, 43.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 https://download.docker.com/linux/ubuntu bionic/stable amd64 docker-ce amd64 18.06.3~ce~3-0~ubuntu [40.2 MB]
Get:1 https://download.docker.com/linux/ubuntu bionic/stable amd64 docker-ce amd64 18.06.3~ce~3-0~ubuntu [40.2 MB]
Fetched 34.6 MB in 16min 22s (35.3 kB/s)
dpkg: warning: downgrading docker-ce from 5:18.09.6~3-0~ubuntu-bionic to 18.06.3~ce~3-0~ubuntu
(Reading database ... 28950 files and directories currently installed.)
Preparing to unpack .../docker-ce_18.06.3~ce~3-0~ubuntu_amd64.deb ...
invoke-rc.d: could not determine current runlevel
 * Stopping Docker: docker                                                                                              start-stop-daemon: warning: failed to kill 4382: No such process
No process in pidfile '/var/run/docker-ssd.pid' found running; none killed.
invoke-rc.d: initscript docker, action "stop" failed.
dpkg: error processing archive /var/cache/apt/archives/docker-ce_18.06.3~ce~3-0~ubuntu_amd64.deb (--unpack):
 installed docker-ce package pre-removal script subprocess returned error exit status 1
E: Sub-process /usr/bin/dpkg returned an error code (1)

docker使用的时候版本报错, 搜索了一下百度,看到好像是版本不兼容, 降个版本试试,没想到卸载也失败,重装也失败, 使用如下的解决方案后, 把软件重装可以成功了.

 

解决方案:

进入如下目录:

cd /var/lib/dpkg

删除下面这个文件:

sudo mv info info.baksudo

重新创建这个文件:

 sudo mkdir info

你可能感兴趣的:(各种问题)