Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove composer

I installed composer while trying to install cakePhp, but the installation was not successful and I want to uninstall composer. I am not finding any way to do this.

For the installation I used the command curl -s https://getcomposer.org/installer | php

I am working in linux

like image 373
Lazarus Rising Avatar asked May 22 '15 12:05

Lazarus Rising


People also ask

How do I completely remove composer from Ubuntu?

If you install the composer as global on Ubuntu, you just need to find the composer location. and then just remove the folder using rm command.

How do I uninstall composer from my Mac?

If you ran composer-setup. php without any additional arguments it should be in a file called composer. phar in the directory where you ran those commands. Delete that file and you're done.

Can I delete composer json?

You don't have to delete it, but if you're not using composer, there's no reason to keep it.


6 Answers

During the installation you got a message Composer successfully installed to: ... this indicates where Composer was installed. But you might also search for the file composer.phar on your system.

Then simply:

  1. Delete the file composer.phar.
  2. Delete the Cache Folder:
    • Linux: /home/<user>/.composer
    • Windows: C:\Users\<username>\AppData\Roaming\Composer

That's it.

like image 191
Jens A. Koch Avatar answered Oct 05 '22 07:10

Jens A. Koch


Uninstall composer

To remove just composer package itself from Ubuntu 16.04 (Xenial Xerus) execute on terminal:

sudo apt-get remove composer

Uninstall composer and it's dependent packages

To remove the composer package and any other dependant package which are no longer needed from Ubuntu Xenial.

sudo apt-get remove --auto-remove composer

Purging composer

If you also want to delete configuration and/or data files of composer from Ubuntu Xenial then this will work:

sudo apt-get purge composer

To delete configuration and/or data files of composer and it's dependencies from Ubuntu Xenial then execute:

sudo apt-get purge --auto-remove composer

https://www.howtoinstall.co/en/ubuntu/xenial/composer?action=remove

like image 45
Pažout Avatar answered Oct 05 '22 07:10

Pažout


Additional information about removing/uninstalling composer

Answers above did not help me, but what did help me is removing:

  1. ~/.cache/composer
  2. ~/.local/share/composer
  3. ~/.config/composer

Hope this helps.

like image 39
drakonli Avatar answered Oct 05 '22 06:10

drakonli


If you install the composer as global on Ubuntu, you just need to find the composer location.

Use command

type composer

or

where composer

For Mac users, use command:

which composer

and then just remove the folder using rm command.

like image 41
robspin Avatar answered Oct 05 '22 05:10

robspin


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

If you have installed by this way simply

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

In this case path will be /usr/local/bin/composer

Run this command sudo rm /usr/local/bin/composer/composer.phar

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

like image 28
Mahtab Alam Avatar answered Oct 05 '22 06:10

Mahtab Alam


Find the Location of the Composer by typing this command

whereis composer

Then You will get the output like this

composer: /usr/local/bin/composer

then cd /usr/local/bin/

then remove composer by this command

sudo rm -r composer
like image 33
Zenonymous Avatar answered Oct 05 '22 05:10

Zenonymous