Automating apt-get install with --assume-yes

Your problem is that the option should be before the packages, not after, this is the correct syntax:

apt-get <options> command package=version/release

So, for it to work it should be:

sudo apt-get --assume-yes install python-software-properties

apt-get is forgiving when mixing up command and options, but to err on the safe side, you should always use the options before the command and never put options or commands after the name of the package.


Add -y flag to apt-get install <package-name> command like below, you won't get any prompt while installing packages.

sudo apt-get install -y <package-name>

From apt-get --help

-y  Assume Yes to all queries and do not prompt

For another silent and effective way as follows :

sudo DEBIAN_FRONTEND=noninteractive apt-get install -qq python-software-properties < /dev/null > /dev/null

Tags:

Apt

Scripts