I'm quite fed up with tracking packages of PHP extensions that are needed for some GUIs like PHPMyAdmin or some CMSs like Drupal.

For example, I once did:

apt upgrade php-{cli,curl,mbstring,mcrypt,gd}

but now mcrypt is deprecated.

Also, in Arch Linux, some php-extension packages are included OOB in the php package.

Is there an apt command to install all PHP packages whatsoever that I could run after apt install lamp-server^ to save all this tracking?

Maybe apt install php is exactly what I need? Pilot6 thank you !

 apt-get install `apt-cache search php- | grep ^php- | cut '-d ' -f1`

The result may not be pretty: on my debian + deb-multimedia system this finds 408 packages.


apt install will match substring regexes if the package name is given with ., ? or *, so

sudo apt install php.*

will install all packages with names containing php.

(This isn’t a good idea.)

  • This will install all versions of php as well from 1.x-7.x and all their remaining extensions, right? This could be 1 gb or more if so.
    – user149572
    Mar 2 '19 at 9:32
  • No, it can’t invent packages, so it won’t install PHP 1, 2 etc. In Debian 9 it will install PHP 7.0 and all available extensions (and debug packages if you have the debug repositories in your list of sources). You asked for a “command to install all PHP packages whatsoever”; this is such a command. Mar 2 '19 at 10:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy