Disable prompts while installing a Debian package

China☆狼群 提交于 2019-12-18 07:07:25

问题


How can i disable totally the prompts that appear while installing a Debian package, i've used all the options that i've found but there are some packages that are still prompting.

I'm using this command:

apt-get -y --allow-unauthenticated --force-yes -o DPkg::Options::="--force-overwrite" -o DPkg::Options::="--force-confdef" install x11-common

Why the x11-common package is still prompting? how can i get rid of these prompts?

Thanks in advance

--Victor


回答1:


You don't provide any details about what prompt this is, but I am guessing it is debconf prompting for configuration questions.

If so, you can set debconf to noninteractive mode. For example, by doing dpkg-reconfigure debconf and then it will use the defaults for everything.

Regards.




回答2:


You need to tell debconf to use the noninteractive frontend, like this:

DEBIAN_FRONTEND="noninteractive" apt-get -y --allow-unauthenticated --force-yes -o DPkg::Options::="--force-overwrite" -o DPkg::Options::="--force-confdef" install x11-common



回答3:


The proper solution to avoid prompts without necessarily accepting defaults is to use preseeding. This means you populate the Debconf database with answers to the questions the package installation is going to ask, and then it won't ask because it gets the answers from the database.

You might still want to use an option to disable interactive prompting, just to be on the safe side.

(A lot of the preseeding documentation you find on the Internet is specifically about unattended system installation, but you can use preseeding for any individual package at any point before installing it.)



来源:https://stackoverflow.com/questions/4401431/disable-prompts-while-installing-a-debian-package

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!