Question:
How to update Drupal core with Composer
This describes a quick process of updating Drupal core.
1. Make back-ups.
Then run the composer command
See: https://www.drupal.org/project/drupal/releases/10.1.6
To start a new Drupal project with version 10.1.6:
composer create-project drupal/recommended-project:10.1.6 "install-dir"
To update your site and all dependencies to the latest version of Drupal:
composer update "drupal/core-*" --with-all-dependencies
To update your site to this specific release:
composer require drupal/core-recommended:10.1.6 drupal/core-composer-scaffold:10.1.6 drupal/core-project-message:10.1.6 --update-with-all-dependencies
The stuff below is likely to cause problems within composer...
composer update drupal/core-recommended --with-all-dependencies
or
composer update drupal/core-recommended --with-dependencies (this tends to work when the above doesn't)
If the composer command --with-all-dependencies does not work then the command --with-dependencies may work.