Not able to install Docker compose in Linux
Asked Answered
S

6

5

I am not able to install docker compose on my Linux system.getting below error after running installation command:

~$ 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).

Can anyone please help me out? I tried sudo apt-get clean as well but no use

Sverdlovsk answered 14/6, 2018 at 14:58 Comment(3)
Did you try 'apt-get -f install' with no packages like the error message says?Cleon
it says E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?Sverdlovsk
So, try sudo apt-get -f install with no packages :)Coppinger
M
6

I think the easiest way to install docker-compose is via pip:

sudo apt-get install python-pip
sudo pip install docker-compose
Moshemoshell answered 14/6, 2018 at 15:24 Comment(0)
A
3

Install Docker Compose on Linux systems
1. Run this command to download the latest version of 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. Apply executable permissions to the binary:

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

3. Test the installation.

$ docker-compose --version

For more detail information please refer docker manuals: https://docs.docker.com/compose/install/

Anaanabaena answered 22/9, 2018 at 19:56 Comment(1)
I tried this command and get docker-compose --version usr/bin/docker-compose no such file or directoryLockyer
N
1
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

Pay attention to the "v" in v2.17.2. Remove the v for versions 1.x.

Nabataean answered 8/4, 2023 at 18:44 Comment(0)
A
0

Hellow, you can't get packages depend. Mayby your system is old and repozytory packages is not suported e.g. in Wheezy. Mayby is other problems. I dont now, becous you have not written more information about your system that you use (e.g. system version, repository list - cat /etc/apt/sources.list, e.t.c.). I suggests you to use use this oficial tutorial to install docker-compose in debian with the official docker page - src: https://docs.docker.com/compose/install/ (you can use curl to download latest binary docker-compose and adapt it for use or using pip tool to install docker-compose - according to the official tutorial) or using the solution given in this page (e.g. pip tool). I used docker oficial tutorial to reinstall docker-compose in my system (to latest version). Was helpful. I use Debian 9 "Stretch" (latest, stable).

Ps. do not forget remove older installation docker-compose when you use other solutions to installation docker-compose.

Arctic answered 15/6, 2018 at 9:43 Comment(0)
C
0

You dont need to install docker compose. It is availble from dockerhub as a docker image ,... so you can run it from docker.

Catinacation answered 17/6, 2018 at 6:52 Comment(0)
F
0

Install Docker-Compose in Ec2:

If Docker isn't installed, run the following commands:

sudo yum update -y
sudo amazon-linux-extras install docker
sudo service docker start
sudo usermod -a -G docker ec2-user

Log out and log back in again to re-evaluate group membership.

Install Docker Compose:

You can install Docker Compose using curl to download the executable:
sudo curl -L "https://github.com/docker/compose/releases/download/v2.5.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

Adjust the version number in the URL as needed based on the latest release. Set the permissions:

Make the downloaded file executable:

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

To verify that Docker Compose was installed correctly, you can run:

docker-compose version

Optional (For convenience):

Add a symbolic link to make it available as docker compose:

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

That's it! Now you have Docker Compose installed on your Amazon Linux EC2 instance, and you can start using it to manage multi-container Docker applications defined in a YAML file.

Fogbound answered 20/10, 2024 at 19:5 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.