Magento 2: Upgrade/Update using Command Line & Composer
This article shows how you can upgrade/update your Magento 2 version through command line using composer.
In this example, I am upgrading Magento 2 to version 2.1.1.
Here are commands to run on terminal/command-prompt:
composer require magento/product-community-edition 2.1.1 --no-update
rm -rf var/di var/generation
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento indexer:reindex
Note: In Ubuntu/Debian Linux, if you are having permission issues then try using sudo at the beginning of every command. For example,
sudo composer update
After you have upgraded Magento 2, you can check your Magento’s version with the following command:
php bin/magento --version
If you get cache write permission error when you browse your Magento site after upgrade, then run the following command to give write permission to pub and var directories:
chmod -R 777 pub var
Hope this helps.