How to install old version of composer

If you came here searching for downgrading from composer 2.0 to 1.0

composer self-update --1


These commands will install composer binary in composer.phar file in current working directory. You may try to verify this by running php composer.phar -v command. composer command will most like point to some global installation in your system - you need to move new binary to correct place, so it could be recognized as global command (see docs):

mv composer.phar /usr/local/bin/composer

If you have already Composer installed, you should able to use self-update command to downgrade to any version:

composer self-update 1.4.1

or

sudo -H composer self-update 1.4.1

Curl can be used to download a specific version:

curl -O "https://getcomposer.org/download/1.10.17/composer.phar"
chmod a+x composer.phar
sudo mv composer.phar /usr/local/bin/composer