Linux Install Docker Error: Failed to restart docker.service: Unit docker.service not found.

Exception during Linux Installation of docker: failed to restart docker.service: unit docker.service not found

Linux CentOS version confirmation

1. Linux system centos7 installation docker
install here in centos7. You can use the following command to view the CentOS version

lsb_release -a

Check whether docker list is installed

yum list installed | grep docker

2.2 installing docker

yum -y install docker

-Y means do not ask for installation until the installation is successful. After the installation, check the installation list again

2.3 start docker

systemctl start docker

2.4 viewing docker service status

systemctl status docker
    1. linux centos8 installation docker
    1. installation dependency
yum install -y yum-utils  device-mapper-persistent-data  lvm2
 yum-config-manager  --add-repo
 yum install docker-ce docker-ce-cli

Install docker

yum install docker-ce docker-ce-cli

Start docker

systemctl start docker

Startup self startup

Set the docker to start automatically after startup

systemctl enable docker

Read More: