Coder Perfect

How can I remove a package from Composer globally?


To install PHPUnit worldwide, I used the following command:

composer global require 'phpunit/phpunit=3.7.*'

Now I’d like to uninstall PHPUnit on a global scale.

Any ideas?

Asked by winkster

Solution #1

Run the following command to uninstall a package that has been installed globally:

composer global remove phpunit/phpunit

Many commands, such as install, require, and update, can be run from the COMPOSER HOME directory using the global command.

Visit for more information.

COMPOSER HOME depends on your system (on Linux, it’s /.composer); for additional information, visit

Answered by Jakub Zalas

Solution #2

You can also utilize another method.

cd $HOME/.config/composer

Also, remove certain required places from the composer.json file.

Finally, run composer update. This is a long way, but it is becoming clearer.

Answered by WiRight

Post is based on