I am running Debian 8 Jessie, trying to install PHP command line intepreter from a shell script.
Here is what I do:
sudo apt-get install php-cli
it tells me there is no php-cli
. I do find there is php5-cli
. However, to make my script more robust, e.g. when running on a recent ubuntu server offering php7
, I do not want to specify php5-cli
.
I googled for an answer but what I get only confused me:
xrfang@P-qapub:~$ sudo apt-get install --names-only "php*-cli"
E: Command line option --names-only is not understood
xrfang@P-qapub:~$ sudo apt-cache search --names-only php-cli
php-google-api-php-client - Google APIs client library for PHP
xrfang@P-qapub:~$ apt-cache search --names-only "php\d+-cli$"
xrfang@P-qapub:~$ apt-cache search --names-only "php\d-cli$"
xrfang@P-qapub:~$ apt-cache search --names-only "php\\d-cli$"
xrfang@P-qapub:~$ apt-cache search --names-only "php5-cli$"
php5-cli - command-line interpreter for the php5 scripting language
My questions are:
I do not want the Google API for PHP, so I try to use regex, but as shown above it just does not accept
\d
.Is it possible to use --name-only somehow with
apt-get install
, notapt-cache search
.
Thanks!