Skip to content

Instantly share code, notes, and snippets.

@harisrozak
Last active March 17, 2022 09:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harisrozak/c514f2692beedda42570208504afdaf9 to your computer and use it in GitHub Desktop.
Save harisrozak/c514f2692beedda42570208504afdaf9 to your computer and use it in GitHub Desktop.
Install Composer on Ubuntu

Install Composer on Ubuntu

Based on the official instruction here: https://getcomposer.org/doc/faqs/how-to-install-composer-programmatically.md

Install PHP CLI

sudo apt install --assume-yes php-cli unzip

Download the executable phar directly from the github commit

You may replace the commit hash by whatever the last commit hash is on https://github.com/composer/getcomposer.org/commits/main

cd ~
wget https://raw.githubusercontent.com/composer/getcomposer.org/d3b829dc7a936a67d4fb9baf7e3502cb55d77548/web/installer -O - -q | php -- --quiet

Install the executable phar file to ubuntu

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

Try to run the composer

composer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment