简体   繁体   中英

apt-get with quiet option is still noisy

Trying to use apt-get in a script, so I'm using the apt-get -qq -y option, as I want to have my install script show something like...

Installing SUDO....DONE

But for some reason apt-get is still producing lots of output, with this option, which means I end up getting...

Installing SUDO....
Selecting previously unselected package sudo.
(Reading database ... 48056 files and directories currently installed.)
Preparing to unpack .../sudo_1.8.10p3-1+deb8u5_amd64.deb ...
Unpacking sudo (1.8.10p3-1+deb8u5) ...
Processing triggers for man-db (2.7.0.2-5) ...
Processing triggers for systemd (215-17+deb8u5) ...
Setting up sudo (1.8.10p3-1+deb8u5) ...
DONE

So my install script just looks messy for a basic package install, let alone for all the other packages.

Am I missing something?

Try to run sudo DEBIAN_FRONTEND=noninteractive apt-get install -qq sudo < /dev/null > /dev/null

Source: https://peteris.rocks/blog/quiet-and-unattended-installation-with-apt-get/

here is an example that is totally quiet and does not output any line on my machine including warnings. Used 2>/dev/null to disable warnings as well

!apt install octave -qq 2>/dev/null >/dev/null;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM