ChatGPT解决这个技术问题 Extra ChatGPT

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

What do you mean by "but the installation was not successful"? Would you care for fixing installation?
@TomasVotruba I mean that some components were not installed properly. I would care for fixing it - if I could. But I've struggled with fixing it for a while now so I thought I would just try to install it all over.

J
Jens A. Koch

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:

Delete the file composer.phar. Delete the Cache Folder: Linux: /home//.composer Windows: C:\Users\\AppData\Roaming\Composer

That's it.


Where is the composer file?
just add little extra information that I didn't find the .composer and was unable to reinstall it again. I just did it by deleting the composer folder in C:\Users\myusername\AppData\Roaming and it worked.
just a reminder. If you installed composer from the root account, you have to delete the files from that same account, otherwise you will get the error "permission denied".
The composer cache folder is sometimes at /home/<user>/.config/composer
Just use the uninstaller located at C:\ProgramData\Composer\bin
P
Pažout

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


not make sense, it is one file as jens's answer or an apt package? Please explain...
d
drakonli

Additional information about removing/uninstalling composer

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

~/.cache/composer ~/.local/share/composer ~/.config/composer

Hope this helps.


In my case removing the installation file was enough. but in many other scenarios you may need to remove configuration files, cache etc. Generally speaking it is a good idea to remove every file installed, whether you want to reinstall or uninstall a package / program. Thumbs up for the answer.
on debian I don't have those files, and yet the problem persists
H
Harshit

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.


which composer for macos.
Thanks, helped my day.
For mac users - which composer will be used. I'll add it to the answer.
M
Mahtab Alam
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

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


Z
Zenonymous

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