(In order to skip the are you sure warning of the disk space)
I tried apt-get install php && echo Y
but it does not work. It still asks for the warning.
What I can do?
Thanks!
The man page says you should use the -y
option.
-y, --yes, --assume-yes
Automatic yes to prompts. Assume "yes" as answer to all prompts
and run non-interactively. If an undesirable situation, such as
changing a held package or removing an essential package, occurs
then apt-get will abort.
That is to say:
apt-get -y install php
You need to understand what && is actually doing, it tells the shell to run the following command if the earlier commands exits with success. So what you are asking for is echo Y
if the install works, this is clearly not what you want.
You may have some success with
echo Y | apt-get install php
But you will have more success with reading the documentation where you will find
-y, --yes, --assume-yes Automatic yes to prompts. Assume "yes" as answer to all prompts and run non-interactively. If an undesirable situation, such as changing a held package or removing an essential package, occurs then apt-get will abort.
So
apt-get -y install php
is what you want.