Shorter way to apt-get install php7.0-{some modules}

Solution 1:

As @Videonauth suggested, you can use apt-get install php7.* but that will install all packages whose names contain php7. To install those whose names starts with php7, use apt-get install '^php7. *. To instal only those on your list, you can use brace expansion. The format is almost what you already tried: braces but a comma-separated list:

$ echo foo{a,b,c}
fooa foob fooc

Therefore:

$ echo php7.0-{fpm,mbstring,mcrypt,phpdbg,dev,curl,sqlite3,json,gd,cli}
php7.0-fpm php7.0-mbstring php7.0-mcrypt php7.0-phpdbg php7.0-dev php7.0-curl php7.0-sqlite3 php7.0-json php7.0-gd php7.0-cli

So, you could run:

sudo apt-get install php7.0-{fpm,mbstring,mcrypt,phpdbg,dev,curl,sqlite3,json,gd,cli}