In this post, I want to show you how you can upgrade the composer to the newest version (at this time, composer version 2 is the newest.).
1: we can remove the composer and install it again. If you are using Ubuntu 20 composer version 2 will install
for remove (full remove) you can use below command
sudo apt purge composer
for install it again you can do like below
sudo apt install composer
note : if you are login as root user you do not need to sudo
2: if you want to upgrade the composer to version 2 wit
hout removing it do like this
cd /tmp/
curl -sS https://getcomposer.org/installer -o composer-setup.php
sudo php composer-setup.php --install-dir=/usr/bin --filename=composer
if all things go to correct you should have composer version 2.
for check composer version use this command
composer --version
The composer version 2 is very new, and maybe some of the frameworks or cms like Magento does not work with that. you can downgrade to version 1
the below code return the composer to last version 1
composer self-update --1