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
  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值