You are not logged in.

#1 2021-12-18 10:11:14

Biaogo
Member
Registered: 2020-08-07
Posts: 14

How to install dependencies when installing software

When I install the software, there are a lot of dependency prompts. Is there any way to install the dependencies when installing the software?

Offline

#2 2021-12-18 12:37:41

Ferdinand
Member
From: Norway
Registered: 2020-01-02
Posts: 338

Re: How to install dependencies when installing software

Do you mean listings of optional dependencies for packages?

You can install them as dependencies by installing them and using the parameter --asdeps to pacman, this will mark them as installed as dependencies, so that they will be removed if all packages that depend on them are removed.

Say, if you install xarchiver, you'll have output like

...
Optional dependencies for xarchiver
    arj: ARJ support
    binutils: deb support [installed]
    bzip2: bzip2 support [installed]
    cpio: RPM support
    gzip: gzip support [installed]
    lha: LHA support [installed]
    lrzip: lrzip support
    lz4: LZ4 support [installed]
    lzip: lzip support
    lzop: LZOP support
    p7zip: 7z support [installed]
    tar: tar support [installed]
    unarj: ARJ support
    unrar: RAR support [installed]
    unzip: ZIP support [installed]
    xdg-utils: recognize more file types to open [installed]
    xz: xz support [installed]
    zip: ZIP support [installed]
    zstd: zstd support [installed]
...

then if you want the arj package, you can install it as a dependency like this:

sudo pacman --asdeps -S arj

Last edited by Ferdinand (2021-12-18 12:38:19)

Offline

#3 2021-12-18 15:19:48

Biaogo
Member
Registered: 2020-08-07
Posts: 14

Re: How to install dependencies when installing software

I mean, Install optional deps packages

...
Optional dependencies for xarchiver
    arj: ARJ support                          ------------------------------------------------------|
    binutils: deb support [installed]                                                               |                         
    bzip2: bzip2 support [installed]                                                                |                        
    cpio: RPM support                                                                               |     
    gzip: gzip support [installed]                                                                  |                    
    lha: LHA support [installed]                                                                    |                  
    lrzip: lrzip support                                                                            |     
    lz4: LZ4 support [installed]                                                                    |                  
    lzip: lzip support                                                                              | 
    lzop: LZOP support                                                                              |     
    p7zip: 7z support [installed]                                                                   |------------- Install with these
    tar: tar support [installed]                                                                    |                
    unarj: ARJ support                                                                              |    
    unrar: RAR support [installed]                                                                  |                      
    unzip: ZIP support [installed]                                                                  |                     
    xdg-utils: recognize more file types to open [installed]                                        |                                                              
    xz: xz support [installed]                                                                      |              
    zip: ZIP support [installed]                                                                    |                  
    zstd: zstd support [installed]   ---------------------------------------------------------------|                                                               
...

Last edited by Biaogo (2021-12-18 15:42:33)

Offline

#4 2021-12-18 15:44:02

Scimmia
Fellow
Registered: 2012-09-01
Posts: 12,445

Re: How to install dependencies when installing software

No, there is no way to automatically pull in all optional deps.

Offline

#5 2021-12-18 16:00:12

Biaogo
Member
Registered: 2020-08-07
Posts: 14

Re: How to install dependencies when installing software

Scimmia wrote:

No, there is no way to automatically pull in all optional deps.

OK, I'm trying to use this to filter out the contents of optional DEPs

LC_ALL=C pacman -Si python | awk -F'[:<=>]' '/^Optional/ {print $2}' | xargs -n1 | sort -u

Then use

Pacman $(code)

to install
But I don't know how to filter line breaks

...
Optional Deps   : python-setuptools
                  python-pip
                  sqlite
                  mpdecimal: for decimal
                  xz: for lzma
                  tk: for tkinter
...

Last edited by Biaogo (2021-12-18 16:00:27)

Offline

#6 2021-12-18 16:59:07

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,338
Website

Re: How to install dependencies when installing software

Well, this is a bad idea, but if you really want to do that, use expac:

expac -S %o python

Did I mention, this is probably a bad idea?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#7 2021-12-19 07:01:25

Biaogo
Member
Registered: 2020-08-07
Posts: 14

Re: How to install dependencies when installing software

Trilby wrote:

Well, this is a bad idea, but if you really want to do that, use expac:

expac -S %o python

Did I mention, this is probably a bad idea?

thank you bro,But I need to search for dependencies of packages that are not installed

Last edited by Biaogo (2021-12-19 11:20:43)

Offline

#8 2021-12-19 13:11:35

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,338
Website

Re: How to install dependencies when installing software

And that's precisely what the command I provided will do.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB