$ sudo add-apt-repository ppa:tiagohillebrandt/wp-cli
$ sudo apt-get update
$ sudo apt-get install wp-cli
https://linuxhandbook.com/install-wp-cli-linux/ - dont run under root :)
Once you’ve verified requirements, download the wp-cli.phar file using wget or curl:
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
Next, check the Phar file to verify that it’s working:
php wp-cli.phar --info
To use WP-CLI from the command line by typing wp, make the file executable and move it to somewhere in your PATH. For example:
chmod +x wp-cli.phar sudo mv wp-cli.phar /usr/local/bin/wp
If WP-CLI was installed successfully, you should see something like this when you run wp --info:
wp core download
asdf