php bin/magento maintenance:enable
cp composer.json composer.json.bak
composer require magento/product-community-edition=2.4.0 --no-update
бывает надо добавить --interactive-magento-conflicts. Подсказка в терминале
composer update
php bin/magento cache:clean
rm -rf var/cache/*
rm -rf var/page_cache/*
rm -rf generated/code/*
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento maintenance:disable