无法从终端运行 Docker - exec:“com.docker.cli”:在 $PATH 中未找到可执行文件

无法从终端运行 Docker - exec:“com.docker.cli”:在 $PATH 中未找到可执行文件

Linux Ubuntu 22.04

我是这样安装 Docker 的:

sudo dpkg -i docker-desktop-4.16.2-amd64.deb 
[sudo] password for alexeij:               
(Reading database ... 483879 files and directories currently installed.)
Preparing to unpack docker-desktop-4.16.2-amd64.deb ...
Unpacking docker-desktop (4.16.2-95914) over (4.16.2-95914) ...
dpkg: dependency problems prevent configuration of docker-desktop:
 docker-desktop depends on qemu-system-x86 (>= 5.2.0); however:
  Package qemu-system-x86 is not installed.
 docker-desktop depends on docker-ce-cli; however:
  Package docker-ce-cli is not installed.
 docker-desktop depends on pass; however:
  Package pass is not installed.
 docker-desktop depends on uidmap; however:
  Package uidmap is not installed.

dpkg: error processing package docker-desktop (--install):
 dependency problems - leaving unconfigured
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for desktop-file-utils (0.24+linuxmint1) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Errors were encountered while processing:

然后尝试从终​​端运行 docker

docker

但出现错误:

exec: "com.docker.cli": executable file not found in $PATH
Current PATH : /home/alex/.sdkman/candidates/maven/current/bin:/home/alex/.sdkman/candidates/java/current/bin:/home/alex/.sdkman/candidates/gradle/current/bin:

我可以从菜单成功运行 Docker

答案1

1.

如果要在终端中运行 Docker Desktop,应该运行:

systemctl --user start docker-desktop

2.

如果想使用 docker 引擎,这会有所帮助。

在 ubuntu 上安装 docker 引擎

此后,检查版本和可执行文件

which docker && docker verion

另外,确保 docker 正在运行

systemctl status docker

相关内容