7

My Ubuntu 20.04 installs version 1.25.0 of docker-compose while the most recent version is 2.0.1 (why is that?).

Is there any method to force Ubuntu to install the latest version?

If not, so I have to follow the official instructions, but the curl command is pointing to /usr/local/bin directory while on my machine it is installed on /usr/bin.

So what is the safe method to upgrade my package?

Omid Shojaee
  • 131
  • 1
  • 1
  • 6
  • See [Why don't the Ubuntu repositories have the latest versions of software?](https://askubuntu.com/questions/151283/why-dont-the-ubuntu-repositories-have-the-latest-versions-of-software). – user535733 Oct 23 '21 at 15:18
  • I clearly asked how to manually upgrade the package. – Omid Shojaee Oct 23 '21 at 15:52
  • The official [Docker pages](https://docs.docker.com/compose/cli-command/) clearly explains how you install this on Linux. However this will be a "manual" installation, and not a package installation. – Artur Meinild Oct 23 '21 at 16:00
  • 1
    I never asked for a package installation. And the main reason I asked this question here is that the folder structure of what I have now is different from the instructions on docker page (as I clearly mentioned in the question). – Omid Shojaee Oct 24 '21 at 11:11
  • Same issue for me, I use Ubuntu 18.04 and I have dc v1.17. The doc, for example for .env use : https://docs.docker.com/compose/environment-variables/#the-env-file specify version 1.28, so I would like to upgrade on my computer and my server. – bcag2 Feb 16 '22 at 11:14

2 Answers2

4

Docker-compose takes place only in a binary file, so it is easy to put the last version !
First, if you have a previous installed version, remove it, in my case, I had version from main repository, so I ran :
sudo apt remove docker-compose
then go to https://github.com/docker/compose/releases and download, for example, for 2.2.3 : https://github.com/docker/compose/releases/download/v2.2.3/docker-compose-linux-x86_64
or other one
then move this file to :
sudo mv docker-compose-linux-x86_64 /usr/local/bin/docker-compose
and
sudo chmod +x /usr/local/bin/docker-compose
check d-c runs correctly :  docker-compose --version
that returns in my case : Docker Compose version v2.2.3

Under ubuntu 18.04, official docker are today at v19.03.13 and it is ok to work with compose v2

See also :

bcag2
  • 440
  • 7
  • 16
0

You are using an older release of Ubuntu, which generally runs older software. To run newer software, use a newer release of Ubuntu.

See Why don't the Ubuntu repositories have the latest versions of software?.

Note that the newest deb package for docker-compose is 1.27.
nobody has packaged 2.0.1 yet.

The BEST way to get newer deb packages is to help the Debian volunteers package it.

user535733
  • 58,040
  • 10
  • 106
  • 136
  • Did you read the entire question? – Omid Shojaee Oct 23 '21 at 15:47
  • @OmidShojaee Did you understand the answer? There is no package of Docker Compose 2.0 yet. – Artur Meinild Oct 23 '21 at 15:58
  • And I asked about the package on Github (refer to the link of official instructions I posted in my question). – Omid Shojaee Oct 23 '21 at 16:18
  • 1
    You seem to want to install software from source (github). However, your Question was ambiguous -- you only made that clear in a comment. This answer was written before you made that clarification. Consider editing your question to clearly ask the question that you want an answer for. You will get better help if you do. – user535733 Oct 23 '21 at 16:30
  • My question was very clear. You didn't read the instructions I linked to. – Omid Shojaee Oct 24 '21 at 11:09