2

I use Ubuntu 15.10 and I am trying to remove Composer, a common PHP dependecy manager. I remove it along with LAMP to reinstall them all for exercise (I am very new to Linux).

It seems that even though I ran the formal command for removing it composer global remove phpunit/phpunit, it isn't being removed...

Here is my input & output in the terminal:

benwork@benwork-VirtualBox:/$ sudo composer global remove phpunit/phpunit
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
Changed current directory to /home/benwork/.composer
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
phpunit/phpunit is not required in your composer.json and has not been removed
Package "phpunit/phpunit" listed for update is not installed. Ignoring.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files

enter image description here

4

The command you are using is not to remove composer itself but to remove packages installed with composer.
In this case you try to remove the package phpunit for all sites running on the system but since there is no dependency for phpunit it is unable to remove this.

To remove composer itself it depends on how you installed it, if it was installed systemwide by apt you can remove it with the command:

sudo apt-get purge composer

If it was installed else-way you can remove single composer installs by removing the composer.phar:

sudo find / -iname composer.phar -exec rm {} \+;

and then remove the cache:

rm -rf /home/<user>/.composer

or try to find out with which packager it was installed to do a clean uninstall using the uninstall from this packager.

3

This is the way that worked for me to uninstall Composer. I will first put here my way to install it, then my way to uninstall and also reinstalling it:

Install Composer:

curl -sS https://getcomposer.org/installer | sudo php
sudo mv composer.phar /usr/local/bin/composer
export PATH="$HOME/.composer/vendor/bin:$PATH"

Reload (terminal).

Uninstall

Delete composer.phar from where you've putted it.

Note: There is no need to delete the exported path.

Reinstall

Than when you reinstall just do the two first stages and the last stage (because the third stage - Exporting the path was already made and I did not reverted it in any way).

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.