如何修复“找不到单元 docker.service”。错误?

Nic*_*ers 2 sudo administration services docker snap

我如何简单地拉动并运行hello-world

\n
nicholas@mordor:~$ \nnicholas@mordor:~$ \nnicholas@mordor:~$ snap list docker\nName    Version   Rev   Tracking       Publisher   Notes\ndocker  20.10.14  1779  latest/stable  canonical\xe2\x9c\x93  -\nnicholas@mordor:~$ \nnicholas@mordor:~$ sudo docker pull hello-world\nUsing default tag: latest\nCannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?\nnicholas@mordor:~$ \nnicholas@mordor:~$ lsb_release -a\nNo LSB modules are available.\nDistributor ID: Ubuntu\nDescription:    Ubuntu 22.04 LTS\nRelease:    22.04\nCodename:   jammy\nnicholas@mordor:~$ \nnicholas@mordor:~$ sudo systemctl start docker\nFailed to start docker.service: Unit docker.service not found.\nnicholas@mordor:~$ \nnicholas@mordor:~$ sudo systemctl status docker\nUnit docker.service could not be found.\nnicholas@mordor:~$ \n
Run Code Online (Sandbox Code Playgroud)\n

也可以看看:

\n

/sf/ask/3127510781/

\n

找不到单位 docker.service

\n

小智 5

就我而言,为了解决“无法找到单位 docker.service”问题,我需要运行...

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
Run Code Online (Sandbox Code Playgroud)

(来源: https: //docs.docker.com/engine/install/ubuntu/