BillionMail icon indicating copy to clipboard operation
BillionMail copied to clipboard

Install Script fail with "A dependency job for docker.service failed"

Open Henrique-BF opened this issue 7 months ago • 1 comments

This error shows when running the install script in a Digital Ocean droplet

Image

Henrique-BF avatar May 28 '25 19:05 Henrique-BF

This is the error "Dependency failed for docker.service - Docker Application Container Engine", indicating that the Docker service cannot start due to dependency issues. Here's how to resolve it:

Check Docker Service Status

Use the command systemctl status docker to view the Docker service status. If it's not running, attempt to start it with sudo systemctl start docker.

Restart Docker Service

If Docker is installed and running but still encountering errors, execute sudo systemctl restart docker to restart the service.

Clear Docker Cache

A corrupted cache might cause problems. Run docker system prune --all --force --volumes to clean up unused images, containers, and volumes.

Update Docker Version

Older versions may have bugs. Update according to your system and package manager:

  • Ubuntu/Debian:
    1. sudo apt-get update
    2. sudo apt-get upgrade docker-ce
  • CentOS/RHEL: sudo yum update docker-ce

Reinstall Docker

If the above methods are ineffective, uninstall and reinstall:

  • Ubuntu/Debian:
    1. sudo apt-get purge docker-ce
    2. sudo rm -rf /var/lib/docker
    3. Reinstall following official documentation.
  • CentOS/RHEL:
    1. sudo yum remove docker-ce
    2. sudo rm -rf /var/lib/docker
    3. Reinstall following official documentation.

Check Dependent Services

Docker depends on services like networking and containerd. Ensure they are running properly:

  • Check status:
    • sudo systemctl status containerd
    • sudo systemctl status networking
  • If not running, restart them:
    • sudo systemctl restart containerd
    • sudo systemctl restart networking

Check System Resources and Permissions

  • Check Resources: Use commands like free -h, df -h, top to check memory, disk space, and CPU usage. If resources are insufficient, free up or add resources.
  • Check Permissions: Inspect permissions of Docker-related directories, e.g., ls -ld /var/lib/docker, ls -l /etc/docker. Fix incorrect permissions with commands like sudo chown -R root:docker /var/lib/docker and sudo chmod -R 755 /var/lib/docker.

dreambladeflag avatar May 29 '25 01:05 dreambladeflag