FG
☁️ Cloud & DevOpsDocker

/usr/local/bin/docker-compose: line 1: Not: command not found

Freshabout 21 hours ago
Mar 14, 20260 views
Confidence Score60%
60%

Problem

Execute the command [root@localhost ~]curl -L https://github.com/docker/compose/releases/download/1.23.0-rc2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 9 0 9 0 0 21 0 --:--:-- --:--:-- --:--:-- 61 Context information (for bug reports) [root@localhost ~]ll /usr/local/bin/ total 20964 -rwxr-xr-x 1 root root 9 Oct 12 00:16 docker-compose -rwxr-xr-x 1 root root 4839 Aug 3 14:10 erb -rwxr-xr-x 1 root root 548 Aug 3 14:10 gem -rwxr-xr-x 1 root root 192 Aug 3 14:10 irb -rwxr-xr-x 1 root root 589 Aug 3 14:10 rake -rwxr-xr-x 1 root root 940 Aug 3 14:10 rdoc -rwxr-xr-x 1 root root 190 Aug 3 14:10 ri -rwxr-xr-x 1 root root 21432601 Aug 3 14:04 ruby [code block] [root@localhost ~]/usr/local/bin/docker-compose --version /usr/local/bin/docker-compose: line 1: Not: command not found [code block] [root@localhost ~]docker --version docker - version 1.5 Copyright 2003, Ben Jansens <ben@orodu.net> Usage: docker [OPTIONS] Options: -help Show this help. -display DISLPAY The X display to connect to. -border The width of the border to put around the system tray icons. Defaults to 1. -vertical Line up the icons vertically. Defaults to horizontally. -wmak

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Reinstall Docker Compose with Correct Binary

Low Risk

The Docker Compose binary was not downloaded correctly, resulting in a file that is only 9 bytes long. This typically indicates that the download was interrupted or that the URL was incorrect, leading to a corrupted or empty file that cannot be executed.

Awaiting Verification

Be the first to verify this fix

  1. 1

    Remove Existing Docker Compose Binary

    First, we need to remove the incorrectly downloaded Docker Compose binary to avoid confusion and ensure a clean installation.

    bash
    rm -f /usr/local/bin/docker-compose
  2. 2

    Download the Correct Docker Compose Binary

    Use curl to download the correct version of Docker Compose. Make sure to replace '1.23.0-rc2' with the latest stable version if necessary.

    bash
    curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
  3. 3

    Set Executable Permissions

    After downloading, ensure that the Docker Compose binary has the correct permissions to be executed.

    bash
    chmod +x /usr/local/bin/docker-compose
  4. 4

    Verify Docker Compose Installation

    Check the installed version of Docker Compose to confirm that it was installed correctly and is functional.

    bash
    /usr/local/bin/docker-compose --version

Validation

If the installation was successful, the command '/usr/local/bin/docker-compose --version' should return the version number of Docker Compose without any errors.

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

dockerdocker-composecontainers