Tags

, , , ,

First you need to issue this command:
ss@ss-desktop:~$ sudo apt-get update
You get this output:
[sudo] password for ss:
Hit:1 http://ppa.launchpad.net/apandada1/brightness-controller/ubuntu xenial InRelease
Hit:2 http://ppa.launchpad.net/ricotz/unstable/ubuntu xenial InRelease
Hit:3 https://dl.winehq.org/wine-builds/ubuntu xenial InRelease
Hit:4 http://in.archive.ubuntu.com/ubuntu xenial InRelease
Hit:5 http://ppa.launchpad.net/webupd8team/java/ubuntu xenial InRelease
Get:6 http://in.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Hit:7 http://ppa.launchpad.net/wine/wine-builds/ubuntu xenial InRelease
Get:8 http://in.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
Get:9 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]
Fetched 323 kB in 2s (130 kB/s)
Reading package lists... Done

Next Commnad is this:
ss@ss-desktop:~$ sudo apt-get install curl php-cli php-mbstring git unzip
And the Output:
Reading package lists… Done
Building dependency tree
Reading state information... Done
unzip is already the newest version (6.0-20ubuntu1).
unzip set to manually installed.
curl is already the newest version (7.47.0-1ubuntu2.11).
curl set to manually installed.
php-mbstring is already the newest version (1:7.0+35ubuntu6.1).
The following additional packages will be installed:
git-man liberror-perl
Suggested packages:
git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk
gitweb git-arch git-cvs git-mediawiki git-svn
The following NEW packages will be installed:
git git-man liberror-perl php-cli
0 upgraded, 4 newly installed, 0 to remove and 26 not upgraded.
Need to get 3,935 kB of archives.
After this operation, 25.6 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 liberror-perl all 0.17-1.2 [19.6 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 git-man all 1:2.7.4-0ubuntu1.6 [736 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 git amd64 1:2.7.4-0ubuntu1.6 [3,176 kB]
Get:4 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 php-cli all 1:7.0+35ubuntu6.1 [2,946 B]
Fetched 3,935 kB in 2s (1,348 kB/s)
Selecting previously unselected package liberror-perl.
(Reading database ... 224389 files and directories currently installed.)
Preparing to unpack .../liberror-perl_0.17-1.2_all.deb ...
Unpacking liberror-perl (0.17-1.2) ...
Selecting previously unselected package git-man.
Preparing to unpack .../git-man_1%3a2.7.4-0ubuntu1.6_all.deb ...
Unpacking git-man (1:2.7.4-0ubuntu1.6) ...
Selecting previously unselected package git.
Preparing to unpack .../git_1%3a2.7.4-0ubuntu1.6_amd64.deb ...
Unpacking git (1:2.7.4-0ubuntu1.6) ...
Selecting previously unselected package php-cli.
Preparing to unpack .../php-cli_1%3a7.0+35ubuntu6.1_all.deb ...
Unpacking php-cli (1:7.0+35ubuntu6.1) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up liberror-perl (0.17-1.2) ...
Setting up git-man (1:2.7.4-0ubuntu1.6) ...
Setting up git (1:2.7.4-0ubuntu1.6) ...
Setting up php-cli (1:7.0+35ubuntu6.1) ...

Then issue these commands one after another:
ss@ss-desktop:~$ cd ~
ss@ss-desktop:curl -sS https://getcomposer.org/installer -o composer-setup.php
ss@ss-desktop:~$ php -r "if (hash_file('SHA384', 'composer-setup.php') === '93b54496392c062774670ac18b134c3b3a95e5a5e5c8f1a9f115f203b75bf9a129d5daa8ba6a13e2cc8a1da0806388a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"

YOu will get this output:

Installer verified
ss@ss-desktop:~$ sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
All settings correct for using Composer
Downloading...

Composer (version 1.8.0) successfully installed to: /usr/local/bin/composer
Use it: php /usr/local/bin/composer

Next, you can test whether the Composer has been installed properly or not:

And you get this output:

ss@ss-desktop:~$ composer
______
/ ____/___ ____ ___ ____ ____ ________ _____
/ / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
/_/
Composer version 1.8.0 2018-12-03 10:31:16

Usage:
command [options] [arguments]

Options:
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
--profile Display timing and memory usage information
--no-plugins Whether to disable plugins.
-d, --working-dir=WORKING-DIR If specified, use the given directory as working directory.
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
about Shows the short information about Composer.
archive Creates an archive of this composer package.
browse Opens the package's repository URL or homepage in your browser.
check-platform-reqs Check that platform requirements are satisfied.
clear-cache Clears composer's internal package cache.
clearcache Clears composer's internal package cache.
config Sets config options.
create-project Creates new project from a package into given directory.
depends Shows which packages cause the given package to be installed.
diagnose Diagnoses the system to identify common errors.
dump-autoload Dumps the autoloader.
dumpautoload Dumps the autoloader.
exec Executes a vendored binary/script.
global Allows running commands in the global composer dir ($COMPOSER_HOME).
help Displays help for a command
home Opens the package's repository URL or homepage in your browser.
i Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json.
info Shows information about packages.
init Creates a basic composer.json file in current directory.
install Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json.
licenses Shows information about licenses of dependencies.
list Lists commands
outdated Shows a list of installed packages that have updates available, including their latest version.
prohibits Shows which packages prevent the given package from being installed.
remove Removes a package from the require or require-dev.
require Adds required packages to your composer.json and installs them.
run-script Runs the scripts defined in composer.json.
search Searches for packages.
self-update Updates composer.phar to the latest version.
selfupdate Updates composer.phar to the latest version.
show Shows information about packages.
status Shows a list of locally modified packages, for packages installed from source.
suggests Shows package suggestions.
u Upgrades your dependencies to the latest version according to composer.json, and updates the composer.lock file.
update Upgrades your dependencies to the latest version according to composer.json, and updates the composer.lock file.
upgrade Upgrades your dependencies to the latest version according to composer.json, and updates the composer.lock file.
validate Validates a composer.json and composer.lock.
why Shows which packages cause the given package to be installed.
why-not Shows which packages prevent the given package from being installed.
ss@ss-desktop:~$

Great, you have successfully installed Composer globally in your system.

One thing about the Composer public Key and the Signature page

You should always replace your key with the current one. You will get that at this Composer-page-link:
Composer Current Key and Signature