Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install specified version of Composer

How to install Composer v1.1.1 in Ubuntu? I have tried below one but its always installed latest version of Composer:

curl -sS https://getcomposer.org/installer | sudo php
sudo mv composer.phar /usr/local/bin/composer
export PATH="$HOME/.composer/vendor/bin:$PATH"
like image 212
Thiyagarajan Avatar asked Jul 13 '18 12:07

Thiyagarajan


People also ask

How do I downgrade composer to specific version?

To change to version one run the self-update command and pass in the --1 flag. This will change composer to version one and now you can install your dependencies. Once you have installed your dependencies, now you can run the same command and pass in --2 as the flag and this will switch back to composer version 2.

How do I install composer Version 1 on Windows?

Installation PHP composer on Windows:Step 1: Navigate to the official composer website. Step 2: Then click on the Download button. Step 3: Then click on the Composer-Setup.exe & download the file. Step 4: Then click on “Install for all users”.

How do I update the old version of the composer?

If you just want to go back to 1. x line, use composer self-update --1 (or composer self-update 1.10. 17 if your composer does not support --1 flag).


1 Answers

If you are using a docker container the following method would be better:

curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --version=1.10.16 

Ensure you have curl installed before using this method. This was tested on ubuntu 20.04 Docker container.

like image 64
Hamfri Avatar answered Sep 28 '22 20:09

Hamfri