You should do all these command in the Magento 2 root folder!
Be careful of it.
Otherwise, you will get an error like «mage2pro/core requires magento/framework >=100.0.0 -> no matching package found».
You can check the current folder with the standard Unix pwd
command.
Step 0 (advisable, but not necessary)
sudo composer self-update
Step 1
composer update --prefer-source
Step 2
bin/magento setup:upgrade
Step 3
rm -rf pub/static/* && bin/magento setup:static-content:deploy <locale, e.g.: en_GB>
How to deploy the static files for a custom locale?
Step 4
rm -rf var/di var/generation generated/code && bin/magento setup:di:compile