gpt4 book ai didi

How to repair docker or reinstall it?(如何修理或重新安装船坞?)

转载 作者:bug小助手 更新时间:2023-10-25 14:43:55 25 4
gpt4 key购买 nike



I have done this command and now docker don't work...

我已经执行了这个命令,现在码头不起作用了.



How can I repair (or reintall) docker properly?

我怎样才能正确修理(或重新安装)码头?



sudo rm -rf /var/lib/docker/aufs


I have try to do

我试着去做



apt-get install --reinstall docker


but it didn't work

但它并没有奏效



this is my error message:

以下是我的错误消息:



docker: Error response from daemon: open /var/lib/docker/aufs/layers/c14f6c4750a2a3fcfa33e6f33041bf4fce087d314fb413ee3662e6e7035fea75: no such file or directory.

更多回答
优秀答案推荐

Try this on ubuntu with docker-ce

用docker-ce在ubuntu上试试



sudo apt-get install --reinstall docker-ce


That was seen only with older versions of docker (issue 22343), but also more recently with 16.04.1 LTS, Docker version 1.12.1, build

这只在较旧的Docker版本(版本22343)上才能看到,但最近在16.04.1LTS,Docker版本1.12.1,内部版本中也是如此


It depends on which docker you are using, and on which host OS.

这取决于您正在使用哪个坞站,以及在哪个主机操作系统上。


If you are on Ubuntu for instance, try removing docker completely (if you don't have any local work that you would want to keep)

例如,如果你在Ubuntu上,试着完全删除docker(如果你没有任何想要保留的本地工作)


sudo apt-get purge docker-engine
sudo apt-get autoremove --purge docker-engine
rm -rf /var/lib/docker # This deletes all images, containers, and volumes

Then install the latest docker 13.1 and see if the issue persists.

然后安装最新的坞站13.1并查看问题是否仍然存在。


Again, this is only if you are ready to start again from a clean state, reinstalling Docker entirely.

Do not execute rm -rf /var/lib/docker without considering the consequences, or in a production environment(!).

同样,这仅在您准备好从干净状态重新开始,完全重新安装Docker时才会发生。请勿在未考虑后果的情况下或在生产环境中执行rm-rf/var/lib/docker(!)。


rakeshz's answer using an apt-get install --reinstall is a safer first step.

Rakehz的答案是使用apt-get安装--重新安装是更安全的第一步。




Note: Crouching Kitten mentions in the comments:

注:评论中提到了蹲下的小猫:



I also had to edit /var/lib/dpkg/info/docker-ce.postinst and add exit 0 on the second line, otherwise the purge command didn't execute.




I was using Docker Desktop on MacOS and couldn't update it.

我在MacOS上使用Docker Desktop,无法更新。


It seemed corrupted.

它似乎已经腐烂了。


I ended up downloading Docker Desktop and just overwrite the current app.

我最终下载了Docker Desktop,只是覆盖了当前的应用程序。



After I do the docker system prune or reset to factory default on Docker Destop but still doesn't get disk space back.
The cause of this is the Temporary files that can't be deleted on Disk Cleanup and I don't know why, but I use the windows 10 and the below steps help me.

在我完成Docker Destop上的坞站系统修剪或重置为出厂默认设置后,仍然无法收回磁盘空间。这是因为临时文件在清理磁盘时无法删除,我不知道为什么,但我使用的是Windows 10,下面的步骤对我有帮助。


Windows search bar >> storage setting >> Configure Storage Sense or run it now >> on Free up space now section, press Clean now button

Windows搜索栏>>存储设置>>配置存储感知或立即运行>>在立即释放空间部分,按下立即清理按钮



First try use docker system prune which will clear out the following things:

首先尝试使用docker系统修剪,它将清除以下内容:



  • all stopped containers

  • all networks not used by at least one container

  • all dangling images

  • all dangling build cache


Try restarting the docker daemon. Since I am using MacOS, the docker desktop has to be restarted in my case.

尝试重新启动docker守护程序。由于我使用的是MacOS,因此必须重新启动扩展底座桌面。


If the problem persists, try: sudo apt remove docker and sudo apt install docker

如果问题仍然存在,请尝试:sudo apt移除docker和sudo apt安装docker


Cleaning all the files related to docker can be helpful as it would clear all the files disturbing the running of docker. This can be done by deleting the var/lib/docker as well as any cache related to it.

清除所有与docker相关的文件会很有帮助,因为它会清除所有干扰docker运行的文件。这可以通过删除var/lib/docker以及与其相关的任何缓存来完成。


更多回答

@MelissaLoos Sorry to hear that. I guess a full reinstallation is the only way?

@MelissaLoos很遗憾听到这个消息。我想完全重新安装是唯一的办法了?

Why would you post this? DO NOT RUN THIS COMMAND!!!!!!!!!!!!!

你为什么要贴这个?不要运行此命令!

@RobertMcelvenny why not? Do you mean that we can reinstall or repair the docker without having to manually delete all the old files (which may size up to 50GB as in my case)? Can a repair (if possible) make the docker engine use those old files (so that right after repairing, we can just run docker images and see all the old images listed correctly?)

@RobertMcelvenny何乐而不为?你的意思是,我们可以重新安装或修复坞站,而不必手动删除所有旧文件(像我这样的文件大小可能高达50 GB)?修复(如果可能)是否可以让停靠引擎使用那些旧文件(这样在修复之后,我们就可以只运行停靠镜像并正确地看到列出的所有旧镜像?)

Because it will remove other required apps, dependencies... special things, not just docker.

因为它将删除其他必需的应用程序、依赖项...特别的东西,不只是码头。

Exactly... and it will break things.

没错..。它会打碎一切。

Their uninstall script might help too: docs.docker.com/desktop/uninstall

他们的卸载脚本可能也会有帮助:docs.docker.com/ktop/uninstall

If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review

如果您有新问题,请通过单击提问按钮来提问。包括指向此问题的链接,如果它有助于提供上下文的话。-摘自评论

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com