one magento developer

my experiences about magento

upgrade composer to version 2

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 -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

Leave a Reply

Your email address will not be published. Required fields are marked *.

You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>