0

I am SUPER LAZY. I want to remove and install some packages at once. Currently, I do the following:

sudo apt remove sth
sudo apt install sth2 sth3

But I am lazy. Any way to do the together without executing APT two times?

Emoji
  • 577

1 Answers1

1

No: The grammar of an apt command is structured to prevent most multiple operations simultaneously. The structure keeps the application simple, easy to troubleshoot, and easy for humans to understand the solver's logic.

For example: A more complex grammar would enable you say something like --install=foo --purge=foo. That might have several meanings (reinstall foo, install then purge foo, or a silly mistake). The simpler grammar prevents USER confusion and frustration.

Sorry that it means a second line for you.

Keep in mind that apt is deliberately interactive. It will often ask you to review and confirm its proposed changes. That's a vital protection for your system. If you decide to string commands together (apt update && apt remove foo && apt install bar), don't make the mistake of disabling those confirmations.

user535733
  • 62,253
  • Thank you. I know how to disable confirm dialog (by -y), then seems like that's the only method. – Emoji Mar 08 '22 at 07:25