Well there isn’t a “1 stop shop” kind of thing when it comes to installing multiple packages, though I mean you can always just alias the whole command if you’re too lazy to type it out. What I tend to always to is have an alias for specific commands such as
alias install='sudo apt-get -y install'
alias update='sudo apt-get -y update'
Then when I want to install something, I just type in
So for this instance, it would be
-y flag automatically confirms and says yes to any confirmation requests you have for whatever package you install.
When I do an update, I just type in
in the terminal which is much faster than typing
sudo apt -y update or
sudo apt-get -y update.
So to answer your question, I mean you can always just alias the whole command like
alias in-php='apt install gettext php-curl php-cli php-mysql php-mysqli php-zip php-json php-cgi php-gd php-mbstring php-seclib php-phpsecli php-pear libapache2-mod-php'
Which in short terms would be “Install PHP” if you will or it could just be
install-php. Other than that, there isn’t a built-in command on Linux or macOS that “automatically” installs the package you want by just typing in the package name if that’s what you’re trying to say.
Though I should mention, you can potentially do
sudo apt -y install php-* which would install all available packages that pertains to PHP using that prefix of
php-. So it would install php-curl, php-cli, php-mysql, php-zip, php-mbstring, etc all in one go.