How to uninstall composer 2

Posted April 12, 2021 3.4k views
UbuntuPHPUbuntu 20.04


thanks for your article. I made a mistake, I install composer 2 with sudo. I want to uninstall. Could explain me how please.

Best regards

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi there,

In case that you’ve followed the steps from this tutorial here, in order to remove composer you could delete the binary file from /usr/local/bin/composer. To do so you can use the rm command for example:

sudo rm /usr/local/bin/composer

Hope that this helps.

by Brian Hogan
In this tutorial, you'll install and get started with Composer on an Ubuntu 18.04 system.
  • Thank you so much. I thought there were dependencies in other place. I feared do not do that properly.

    So I made that you explain and I reinstalled the version 1.

    Related to the tutorial, I had to use sudo to success the install because without that I could’t write on the good place. After that composer doesn’t work without sudo. So as I tried to correct a programm install without sudo, composer 2 doesn’t work correctly.
    It’s for that I uninstall. But perhaps have you a better solution.
    In all case, thanks again for your quick answer.

    • Hi there,

      It sounds like that there might be a problem with the permissions of the composer binary.

      Could you run the following command and share the output here:

      ls -lah /usr/bin/composer

      Also what was the exact error that you were getting when running composer without sudo?


      • Hello,
        thank you for your aswer and sorry for the delay to reply.

        So when I do :
        bruno@BrunoUbuntuServer20:*/usr/local/bin$ ls -lah */usr/local/bin/composer
        -rwxr-xr-x 1 root root 2,2M avril 16 12:06 /usr/local/bin/composer

        and when I run composer install 2 in my cake application :

        “The "composer/installers” plugin was skipped because it requires a Plugin API ve rsion (“^1.0”) that does not match your Composer installation (“2.0.0”). You may need to run composer update with the “–no-plugins” option.
        Do not run Composer as root/super user! See for det ails"

        Thanks for all

      • Hello,
        I try too :
        bruno@BrunoUbuntuServer20:/var/www/html/game/front$ sudo composer install –no-plugins

        Do not run Composer as root/super user! See for details
        Continue as root/super user [yes]? y
        Installing dependencies from lock file (including require-dev)
        Verifying lock file contents can be installed on current platform.
        Your lock file does not contain a compatible set of packages. Please run composer update.

        Problem 1
        - composer/installers is locked to version v1.3.0 and an update of this package was not requested.
        - composer/installers v1.3.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.

        You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

        Have a nice sunday

        • Hi there,

          It looks like that you are still using composer v2. You can check that with the following command:

          composer --version


          • Yes, I want try to install composer V2 on one application made and install with composer V1 because when I try to make some install like debug kit or update like upgrade to one more recent version to cakephp, the message suggest me to install V2.
            But perhaps, it’s not necessary.
            In all case thanks for your help