

So both composer.json and composer.lock are not affected by composer install so the only one thing to achieve the rollback (uninstall) of the composer install is to remove the vendor directory rm -rf vendor

I just want to have a project without any installed dependencies as it was before.įollowing yivi answer I created a simple test to verify: mkdir -p /tmp/composer-install See composer why doctrine/annotations.Īs my intention is to rollback to the state that did not have any package installed but only files: composer.lock and potentially composer.json I really don't care about any dependencies, packages versions, downloading repositories' urls etc. Removal failed, doctrine/annotations is still present, it may be required by another package. I may use someting similar to: for package in $(composer show | awk '') do composer remove -no-interaction -dev -no-install "$package" doneīut that is not a simple and single composer command.Īlso composer often complains about a package being a part (dependency) of another one so composer does not uninstall it. Why composer remove * did not work at all? AFAIK the package name as VendorName/PackageName is a common convention for Packagist but not a must (if you use private repos) so how one would be able to remove all packages named IdontHaveAnySlash etc. Package "bin/console" listed for update is not locked. Is there any single composer command to do that?īin/console is not required in your composer.json and has not been removed How to remove all packages without affecting composer.lock file? Now I would like to rollback that composer install command to the state as it was before running it.


I installed packages with the command: composer install I have a project with the composer.lock file.
