failed to start docker.service :unit docker.service not found
时间: 2024-03-04 14:41:28 浏览: 31
根据引用的内容,当在CentOS中启动Docker时,可能会出现"Failed to start docker.service: Unit docker.service not found"的错误。这是由于CentOS默认使用podman替代了Docker,所以需要卸载podman来解决这个问题。你可以按照以下步骤进行操作:
1. 首先,使用以下命令卸载podman:
```
sudo yum remove -y podman
```
2. 安装Docker CE,可以使用以下命令进行安装:
```
sudo yum install -y docker-ce docker-ce-cli containerd.io
```
3. 安装完成后,启动Docker服务:
```
sudo systemctl start docker
```
这样就应该解决了"Failed to start docker.service: Unit docker.service not found"的问题。希望这能帮到你。如果还有其他问题,请随时提问。
相关问题
hpw to solve failed to start docker.service: unit docker.service not found in kail linux
If you are facing this error "Failed to start docker.service: Unit docker.service not found" in Kali Linux, it means that the docker service is not installed on your system or it is not properly configured.
You can follow the below steps to install and configure docker service on Kali Linux:
1. Update your system by running the command:
```
sudo apt-get update
```
2. Install docker service by running the command:
```
sudo apt-get install docker.io
```
3. Start the docker service by running the command:
```
sudo systemctl start docker
```
4. Enable the docker service to start automatically at system boot by running the command:
```
sudo systemctl enable docker
```
5. Verify that the docker service is running by running the command:
```
sudo systemctl status docker
```
If the above steps do not work, you can try to reinstall the docker service by running the below commands:
```
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get update
sudo apt-get install docker.io
```
After reinstalling the docker service, you can follow the above steps to start and enable the service.
failed to start docker.service: unit docker.service not found.
这个错误是因为缺少docker.service这个单元。解决这个问题的方法有以下几种:
1. 如果你使用的是Red Hat Enterprise Linux 7,可以通过安装rhel-push-plugin软件包来解决。执行以下指令即可:
```
curl -sSL https://get.docker.com/ | sh
```
2. 如果你使用的是CentOS,并且出现了这个错误,可能是因为CentOS默认使用podman代替docker。你可以通过以下步骤解决:
1. 输入以下指令卸载podman和buildah:
```
yum erase podman buildah
```
2. 输入y并等待卸载完成。
3. 安装Docker,可以按照以下步骤进行:
1. 安装依赖环境:
```
yum install -y yum-utils
```
2. 配置阿里云镜像:
```
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
```
3. 安装Docker CE:
```
sudo yum install -y docker-ce docker-ce-cli containerd.io
```
4. 启动Docker服务:
```
systemctl start docker
```