Score:0

How to register a command to confirm the option when installing programs?

cn flag

When installing SageMath through the terminal on Ubuntu 18.04 on command

sudo apt-get install sagemath

I get a notification:

Postfix Configuration
---------------------

Please select the mail server configuration type that best meets your needs.

 No configuration:
  Should be chosen to leave the current configuration unchanged.
 Internet site:
  Mail is sent and received directly using SMTP.
 Internet with smarthost:
  Mail is received directly using SMTP or by running a utility such
  as fetchmail. Outgoing mail is sent using a smarthost.
 Satellite system:
  All mail is sent to another machine, called a 'smarthost', for delivery.
 Local only:
  The only delivered mail is the mail for local users. There is no network.

  1. No configuration 3. Internet with smarthost 5. Local only
  2. Internet Site 4. Satellite system
General type of mail configuration:

Each time I install SageMath, I have to select the [1. No configuration] option.

How do I write a command and make sure that when you run the SageMath installation command, the automatic machine is selected and validated option [1. No configuration]? This is something like the -y flag convention [../YES]

How can I do it? It's just that it's problematic for me to do this manually, since I launch the installation via a Bash script with other installation packages and programs. Every time I have to stop at the SageMath setting on this option and enter this number "1" manually. In GNU/Linux, is there an automatic validation of an option on a specified command?

hr flag
You could consider using `debconf-set-selections` to preseed the selection. See for example [How to use debcondf Show results with debconf-set-selections?](https://askubuntu.com/questions/381593/how-to-use-debcondf-show-results-with-debconf-set-selections)
mbomb007 avatar
so flag
@steeldriver The answers in that question don't tell you how to register a command and its responses. It has "magic strings" like `shared/present-oracle-license-v1-1`, but doesn't tell you how to figure out what to use for any other commands. I didn't find it helpful.
Score:0
cn flag

I got the answer !!! Install by command:

yes '' | sudo env DEBIAN_FRONTEND=noninteractive apt-get -y -o DPkg::options::="--force-confdef" -o DPkg::options::="--force-confold" install sagemath
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.