Detailed information about this step can be found here.
composer global require drush/drush:8.*
composer global update
We can state any Drush version we need. We can also roll back to a necessary release version of Drush using commands above. Now, we can use Drush:
drush version
Don't panic, if you are getting the next message after performing commands above:
The program 'drush' is currently not installed. You can install it by typing: sudo apt install drush
It means that appropriate executable file can't be found. We can fix it by performing one of the following:
- Put appropriate folder on the PATH environment variable:
export PATH="$PATH:$HOME/.composer/vendor/bin"
- Add an alias to the ~/.bashrc file, i.e:
alias drush='php ~/.composer/vendor/drush/drush/drush.php'
Enjoy!