Pertama-tama, mari kita pahami mengapa pesan itu muncul. Bahkan, jika paket tersebut tidak memiliki dependensi yang belum Anda instal atau yang secara eksplisit Anda perintahkan untuk diinstal, apt tidak pernah meminta Anda:
➜ ~ sudo apt-get -qq install xfce4-screenshooter
Selecting previously unselected package xfce4-screenshooter.
(Reading database ... 296146 files and directories currently installed.)
Preparing to unpack .../xfce4-screenshooter_1.8.1-2_amd64.deb ...
Unpacking xfce4-screenshooter (1.8.1-2) ...
Processing triggers for hicolor-icon-theme (0.13-1) ...
Processing triggers for man-db (2.6.7.1-1) ...
Processing triggers for gnome-menus (3.13.3-1) ...
Processing triggers for desktop-file-utils (0.22-1) ...
Processing triggers for mime-support (3.56) ...
Setting up xfce4-screenshooter (1.8.1-2) ...
Sementara jika Anda ingin menginstal paket yang tergantung pada paket yang tidak Anda sebutkan, ia akan bertanya:
➜ ~ sudo apt-get -q install avis
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
libjzlib-java libmina-java libslf4j-java
Suggested packages:
libmina-java-doc libspring-beans-java libcommons-logging-java
liblog4j1.2-java
The following NEW packages will be installed:
avis libjzlib-java libmina-java libslf4j-java
0 upgraded, 4 newly installed, 0 to remove and 14 not upgraded.
Need to get 720 kB of archives.
After this operation, 1,258 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Meski begitu, tidak akan bertanya apakah Anda juga secara implisit mengatakan bahwa Anda ingin menginstal paket itu:
➜ ~ apt-get -q install avis libjzlib-java libmina-java libslf4j-java
Reading package lists...
Building dependency tree...
Reading state information...
Suggested packages:
libmina-java-doc libspring-beans-java libcommons-logging-java
liblog4j1.2-java
The following NEW packages will be installed:
avis libjzlib-java libmina-java libslf4j-java
0 upgraded, 4 newly installed, 0 to remove and 14 not upgraded.
Inst libjzlib-java (1.1.3-1 Debian:testing [all])
Inst libslf4j-java (1.7.7-1 Debian:testing [all])
Inst libmina-java (1.1.7.dfsg-11 Debian:testing [all])
Inst avis (1.2.2-2 Debian:testing [all])
Conf libjzlib-java (1.1.3-1 Debian:testing [all])
Conf libslf4j-java (1.7.7-1 Debian:testing [all])
Conf libmina-java (1.1.7.dfsg-11 Debian:testing [all])
Conf avis (1.2.2-2 Debian:testing [all])
Tetapi, bagaimana cara membuatnya sehingga tidak meminta Anda secara definitif? Melalui jawaban Rizwind harus mencakup solusi ad-hoc dan scripting (pada kenyataannya, opsi itu lebih banyak digunakan dalam skrip) Anda dapat memodifikasi apt.conf
file Anda dan menambahkan:
APT::Get::Assume-Yes
Sesuatu seperti ini seharusnya cukup:
echo 'APT::Get::Assume-Yes;' | sudo tee -a /etc/apt/apt.conf.d/00Do-not-ask
Catatan, ini tidak akan memungkinkan permintaan lebih mengerikan lainnya yang harus Anda verifikasi , seperti:
➜ ~ sudo apt-get install sonar
WARNING: The following packages cannot be authenticated!
sonar
Install these packages without verification? [y/N]
Itulah sebabnya saya tidak akan merekomendasikan penggunaan yes | ...
, karena peringatan ini akan diabaikan.