This is the preferred, Composer method for upgrading Magento 2.X.X between minor versions. Replace X.X with the minor version numbers of the target version. The last line is optional, use it only if you’re in the middle of a migration and need to continue to be able to sync data with a 1.x site. If composer fails, this usually means you manually installed magento via GitHub or a tarball. You should probably go back and reinstall magento via Composer to avoid a world of hurt down the road.
php bin/magento maintenance:enable composer require magento/product-community-edition 2.X.X --no-update composer update rm -rf var/di var/generation php bin/magento cache:clean php bin/magento cache:flush php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento indexer:reindex php bin/magento maintenance:disable composer require magento/data-migration-tool:2.X.X