You are not logged in.

#1 2011-11-17 15:52:23

biltong
Member
From: South Africa
Registered: 2011-09-01
Posts: 118

Printing dependencies?

Is there any way to get pacman to output the dependencies of a package? So far I've got

pacman -Qi <package> | grep -i depend | cut -c18-

but that sometimes includes version numbers or for some reason, the repo the package is in.

Offline

#2 2011-11-17 16:12:11

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Printing dependencies?

pactree

[karol@black ~]$ pactree -ul firefox-nightly
firefox-nightly
desktop-file-utils
glib2
pcre
gcc-libs
glibc
linux-api-headers
tzdata
libffi
libxt
libsm
libice
xproto
util-linux util-linux-ng
filesystem
iana-etc
bash
readline
ncurses
coreutils
shadow
pam
db
cracklib
zlib
libtirpc
libgssglue
acl
attr
gmp
libcap
libx11
libxcb
xcb-proto
libxdmcp
libxau
kbproto
mime-types
nss
nspr
sqlite3
shared-mime-info
libxml2

As you can see, some lines have two items: util-linux util-linux-ng. The first is the package name, the other is what it provides:

[karol@black ~]$ pacman -Qi util-linux | grep Provides
Provides       : linux32  util-linux-ng=2.20.1

If you want to feed the dependency list to a scripts e.g. https://wiki.archlinux.org/index.php/Pa … base_group you may need to remove the second column with

cut -d ' ' -f 1


Edit: You can also check expac https://bbs.archlinux.org/viewtopic.php?id=109358 - it can print other package info too, not only dependencies.

Last edited by karol (2011-11-17 16:19:35)

Offline

#3 2011-11-17 16:34:55

biltong
Member
From: South Africa
Registered: 2011-09-01
Posts: 118

Re: Printing dependencies?

Ah! Thank you! smile

Offline

#4 2011-11-18 14:28:43

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Printing dependencies?

Please remember to mark the thread as solved.

Offline

Board footer

Powered by FluxBB