Install Composer on Raspberry OS

I think it should work for both 32-bit and 64-bit Buster.

Step 1:

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '795f976fe0ebd8b75f26a6dd68f78fd3453ce79f32ecb33e7fd087d39bfeb978342fb73ac986cd4f54edd0dc902601dc') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"

Step 2: the only line changed:

# php composer-setup.php
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
php -r "unlink('composer-setup.php');"

To check:

composer

Source: Composer
Optional: How To Install and Use Composer on Ubuntu 20.04

Leave a Reply

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

Yandex.Metrica