This is an example of how to do it with one line and assumes you are running the script with sudo
or have appropriate privilege.
apt-get -qq update && apt-get -qq --yes --force-yes install tcl
-qq
suppresses output unless an error occurs
--yes
answers the prompt 'Do you want to continue? [Y/n]'
--force-yes
installs packages that come from a private repository
Consider running apt-get update &
earlier in the script. Check or wait for the job to finish before using apt-get install
You can list multiple packages on one line. Packages are installed in the order they are listed.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…