i start to explain how to update composer,
for installation start from step 3.
0.
if you already installed composer you should be able to get
composer version by running composer --version
. if installed go to
step 1.
1.
run composer self-update
if composer got updated then you are good to go
but if you get error saying this command is undefined,
it means you're composer is old(v1)
2.
try removing the composer
sudo apt purge composer
3.
go to https://getcomposer.org/download/ &
copy four lines of php commands & paste into your terminal
press Enter
4.
this is probably the tip of this gist
run these commands
sudo mv composer.phar /usr/bin
cd /usr/bin
sudo mv composer.phar composer
now composer is installed globally,
you can check by running composer
command
in any other directory
---extra steps---
php-curl
extension helps with composer speed.
install it by running
sudo apt install php7.4-curl
beware: 7.4 is my installed php version.
to know yours, run php -v
if it is php 7.4.3
don't run sudo apt install php7.4.3-curl just php7.4-curl
confirm installation of curl extension by running:
php -m | grep "curl"
best regards :)