Howto install WP-CLI Ubuntu 16 and later update

Howto install WP-CLI Ubuntu 16. This is a easy and straight forward process. Takes just a few minutes.

Check for any news on the WP-cli homepage

Issue the following commands:

cd /tmp
wget https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

The file wp-cli.phar needs to be executable.

chmod +x wp-cli.phar

Set permission to copy WP-CLI to /usr/local/bin/

Important: Do not use “sudo” when moving WP-CLI to /usr/local/bin/

sudo chown -R ubuntu /usr/local/bin/

And then

sudo chgrp -R ubuntu /usr/local/bin/

 

Move wp-cli.phar to the bin directory.
Then rename wp-cli.phar to “wp”.
This makes it easier to use the app:

mv wp-cli.phar /usr/local/bin/wp

To test that everything works as it should issue the command:

wp --info

To update WP-CLI to newest version

As Ubuntu user run the command:

wp cli update