failed to start docker.service :unit docker.service not found
时间: 2024-03-04 12:41:28 浏览: 452
根据引用的内容,当在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"的问题。希望这能帮到你。如果还有其他问题,请随时提问。
相关问题
Failed to start docker.service: Unit docker.service not found.
As an AI language model, I do not have access to the environment in which this error occurred. However, this error message suggests that the Docker service is not installed or running on the system.
To resolve this issue, you can try installing Docker using the following commands:
1. Update the package list:
`sudo apt-get update`
2. Install the dependencies:
`sudo apt-get install apt-transport-https ca-certificates curl software-properties-common`
3. Add the Docker GPG key:
`curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -`
4. Add the Docker repository:
`sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"`
5. Update the package list again:
`sudo apt-get update`
6. Install Docker:
`sudo apt-get install docker-ce`
After installing Docker, you can start the Docker service using the following command:
`sudo service docker start`
If the issue persists, you may need to check your system logs and investigate further.
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
```
阅读全文
相关推荐















