DEV Community

Cover image for How to update composer
Antonio Silva
Antonio Silva

Posted on

1

How to update composer

To update Composer on your system, follow these steps:

Update Composer globally

To update Composer on your system, follow these steps:

Update Composer globally:

If you have installed Composer globally (available as the composer command in the terminal), you can use the following command to update it:

composer self-update
Enter fullscreen mode Exit fullscreen mode

Or for a specific version:

composer self-update 2.3.5
Enter fullscreen mode Exit fullscreen mode

This command will download and install the latest version of Composer.

Check the Composer version

After the update, you can check the installed version with:

composer --version
Enter fullscreen mode Exit fullscreen mode

Roll back to a previous Composer version if needed

If you've updated Composer but need to revert to a specific version, use:

composer self-update --rollback
Enter fullscreen mode Exit fullscreen mode

This command will roll back to the previous version.

These steps should work on both Linux distributions and other operating systems.

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay