Sunday, May 12, 2024
8
rated 0 times [  8] [ 0]  / answers: 1 / hits: 3978  / 1 Year ago, thu, december 22, 2022, 8:41:36

When I install Ubuntu, the first thing I usually do is remove some programs and install some others. To get that done, I enter the following in a terminal:



sudo apt-get remove applicationA applicationB applicationC && sudo apt-get install applicationX applicationY applicationZ.



This works nicely, but the problem is that I have to confirm twice: first I have to confirm the removal of the applications, and after some time I have to confirm the installation of the others. It would be great if I only had to confirm once, because I wouldn't have to come back to the computer in the meantime. Is there any command to get that done?



Please note that I'm not looking for workarounds in e.g. Synaptic Package Manager. I want to do this from the command line.



Thanks.


More From » installation

 Answers
5

Use the -y option for apt-get.



From the man page:




-y, --yes, --assume-yes
Automatic yes to prompts; assume "yes" as answer to all prompts and
run non-interactively. If an undesirable situation, such as
changing a held package, trying to install a unauthenticated
package or removing an essential package occurs then apt-get will
abort. Configuration Item: APT::Get::Assume-Yes.



So for you it would look something like sudo apt-get remove -y foo1 foo2 foo3 and sudo apt-get install -y foo foo1 foo2 foo3.


[#40689] Saturday, December 24, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
memorrappin

Total Points: 325
Total Questions: 122
Total Answers: 100

Location: Armenia
Member since Sat, Sep 12, 2020
4 Years ago
;