Composer: remove a package, clean up dependencies, don't update other packages
To remove a package with Composer, you can use the command composer remove [package-name].
To remove a package with Composer, use the command composer remove vendor/package-name. This removes the package from composer.json and composer.lock.
To clean up dependencies, run composer install. This reads composer.lock and removes any packages from the vendor/ directory that are no longer required by your project.
To prevent Composer from updating other packages, simply specify the target package in the update command: composer update vendor/package-name. This updates only the specified package and its direct dependencies, leaving the rest of your dependency tree unchanged.
For more details, see the official Composer CLI documentation on remove and update.