60

How do I install multiple packages?

For example, I want to install both package X and Package Y, I know that this is not possible by default but is there any alternate way of doing this or Can I atleast queue them for installation?

2 Answers2

84

You can do this, why not!? You can run the following single command to install package-x and package-y:

sudo apt-get install package-x package-y

Note:

It has been mentioned that you can add the -y flag to apt-get to answer Yes to all the prompts. This usually only saves you from having to say Yes once, anyways. It's nice to know about the -y flag, but be careful, because it can also automatically remove things that you may not want removed. Typically, I omit the -y flag and manually review all Added or Removed packages to prevent myself from making mistakes that could have horrible affects on my computer. However, apt-get upgrade -y seems to be a good option and less volatile.

sudo apt-get upgrade package-x package-y -y
pomsky
  • 70,557
earthmeLon
  • 11,658
1

In Linux, apt-get/yum/etc can be compared to an "Installer" in windows. One installer can install only one software at a time. You can always install 2 or more software from source, binaries in parallel. Most Linux distributions have a common package manager, or "installer" for most software supported by that distribution. Unlike windows, in which each software comes with its own installer and hence they run in parallel.

In case you were seeking this