...
- install main package
- install optional dependencies as dependencies dependencies (–asdeps
--asdeps
)
Install main package first
...
Install the main wine
package as per usual:
Code Block | ||
---|---|---|
| ||
sudo pacman -S wine |
Once you've installed this, let's move onto installing all optional dependencies.
...
Now, let's install all optional dependencies. We're going to use the pactree
command pacman -Si
command which will list all dependencies (optional and otherwise) for the wine
package that we just installed. Execute the following from the command line:information about the package (including optional dependencies). The rest of the following command is simply processing the output to only show the optional dependency packages:
Code Block | ||
---|---|---|
| ||
sudo pacman | ||
Code Block | ||
sudo pacman -S --asdeps --needed $(pactreepacman -l wine)Si wine | sed -n '/^Opt/,/^Conf/p' | sed '$d' | sed 's/^Opt.*://g' | sed 's/^\s*//g' | tr '\n' ' ') |
Info |
---|
Replace |
The --needed
option will stop pacman from reinstalling a package if it is already installed. In other words, we probably don't want to reinstall a package and mark it as a dependency if it is already on our system (either installed via another package or installed explicitly)As mentioned, the above will use pactree
to list all dependencies (including optional dependencies) and feed these to pacman
to install them.
It's important to note that we should use the --asdeps
argument here to mark these packages's install reason as a "dependency" (otherwise, these packages will be marked as "explicitly" installed). This means that if you uninstall the main package, these optional dependencies will be orphaned - which you can then safely uninstall with a single command (which you can run often to clean up any orphans):
...