无法在Linux中安装Docker compose

3z6pesqy  于 2023-04-11  发布在  Linux
关注(0)|答案(5)|浏览(211)

我无法在我的Linux系统上安装docker compose。运行安装命令后出现以下错误:

~$ sudo apt-get -f install docker-compose
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 code : Depends: libnotify4 but it is not going to be installed
        Depends: libnss3 but it is not going to be installed
        Depends: libxkbfile1 but it is not going to be installed
        Depends: libgconf-2-4 but it is not going to be installed
        Depends: libsecret-1-0 but it is not going to be installed
 docker-compose : Depends: python-cached-property but it is not going to be installed
                  Depends: python-docker (>= 1.9.0) but it is not going to be installed
                  Depends: python-dockerpty (>= 0.4.1) but it is not going to be installed
                  Depends: python-docopt but it is not going to be installed
                  Depends: python-enum34 but it is not going to be installed
                  Depends: python-jsonschema but it is not going to be installed
                  Depends: python-requests (>= 2.6.1) but it is not going to be installed
                  Depends: python-six (>= 1.3.0) but it is not going to be installed
                  Depends: python-texttable but it is not going to be installed
                  Depends: python-websocket but it is not going to be installed
                  Depends: python-yaml but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

有人能帮我吗?我试过sudo apt-get clean,但没有用

s4chpxco

s4chpxco1#

我认为安装docker-compose最简单的方法是通过pip:

sudo apt-get install python-pip
sudo pip install docker-compose
ndh0cuux

ndh0cuux2#

Linux系统安装Docker Compose

1.运行此命令下载最新版本的Docker Compose:

$ sudo curl -L "https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

2.对二进制文件应用可执行权限:

$ sudo chmod +x /usr/local/bin/docker-compose

3.测试安装。

$ docker-compose --version

有关更多详细信息,请参阅docker手册:https://docs.docker.com/compose/install/

cngwdvgl

cngwdvgl3#

你好,你不能得到包依赖. Mayby你的系统是旧的和repozytory包不支持例如.在喘息. Mayby是其他问题.我现在不,因为你没有写更多的信息,你的系统,你使用(例如,系统版本,存储库列表- cat /etc/apt/sources.list,e.t.c.)。我建议你使用这个官方教程在debian中安装docker-compose,使用官方的docker页面- src:https://docs.docker.com/compose/install/(您可以使用curl下载最新的二进制docker-compose并对其进行调整以供使用,或使用pip工具安装docker-compose -根据官方教程)或使用本页面中给出的解决方案(例如pip工具)。我使用docker官方教程在系统中重新安装docker-compose(到最新版本)。很有帮助。我使用Debian 9“Stretch”(最新,稳定)。
Ps.当你使用其他的解决方案来安装docker-compose时,不要忘记删除旧的安装docker-compose。

odopli94

odopli944#

你不需要安装docker compose。它可以从dockerhub作为docker镜像获得,...所以你可以从docker运行它。

njthzxwz

njthzxwz5#

sudo curl -L "https://github.com/docker/compose/releases/download/v2.17.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

sudo chmod +x /usr/local/bin/docker-compose

docker-compose --version

请注意v2.17.2中的“v”。对于版本1.x,请删除v。

相关问题