You are not logged in.

#1 2010-11-12 19:48:02

trusktr
Banned
From: .earth
Registered: 2010-02-18
Posts: 907
Website

[SOLVED] How to see what packages depend on a specified package?

I want to list all the packages that depend on QT. Is there a command for this?

If not, i think it'd be useful to have something like pacman -Qr package-name to list packages that depend on package-name (Like in the "Required By" section of http://archlinux.org/packages/extra/i686/qt/)

Last edited by trusktr (2010-11-12 20:38:06)


joe@trusktr.io - joe at true skater dot io.

Offline

#2 2010-11-12 19:53:38

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: [SOLVED] How to see what packages depend on a specified package?

pacman -Qi qt
pacman -Sii qt

worksforme(tm)


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#3 2010-11-12 19:54:46

GRem
Member
From: Asunción
Registered: 2010-08-20
Posts: 32

Re: [SOLVED] How to see what packages depend on a specified package?

pacman -Qi <package name> will list the information that the packages site shows, including "Required by".
Running it for qt shows me acetoneiso2, smplayer and scribus in said field, for example.

Is this what you need?

Offline

#4 2010-11-12 20:36:26

trusktr
Banned
From: .earth
Registered: 2010-02-18
Posts: 907
Website

Re: [SOLVED] How to see what packages depend on a specified package?

Aha! GRem and Mr.Elendig, i just noticed that pacman -Qi package-name shows only the packages that depend on "package-name" only if they're installed in your system!

I think this is true because GRem, you said yours shows acetoneiso2, smplayer and scribus in the Required By field, but mine doesn't show any of those three. Mine shows "hedgewars  lib32-qt  lmms  qjackctl  qtractor  telepathy-qt4", which are all installed on my system.

What a nice little discovery. So, here's a possible command to output only packages that depend on a given package (qt in this example):

pacman -Qi qt | grep "Req" | sed -e 's/Required By    : //g'

Works beautifully!

Last edited by trusktr (2010-11-12 20:58:33)


joe@trusktr.io - joe at true skater dot io.

Offline

#5 2010-11-12 20:37:03

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

Re: [SOLVED] How to see what packages depend on a specified package?

I second Mr.Elendig -  'pacman -Sii qt' is what you need.

Offline

#6 2010-11-12 20:40:47

trusktr
Banned
From: .earth
Registered: 2010-02-18
Posts: 907
Website

Re: [SOLVED] How to see what packages depend on a specified package?

Yeah, indeed the -Sii command shows all packages that require qt. I was looking just for the ones on my system. In this case -Qi did the trick, and i was able to extract them with the above command. big_smile

Last edited by trusktr (2010-11-12 20:51:35)


joe@trusktr.io - joe at true skater dot io.

Offline

#7 2010-11-12 20:43:47

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

Re: [SOLVED] How to see what packages depend on a specified package?

trusktr wrote:

Yeah, indeed the -Si command shows all packages that require qt. I was looking just for the ones on my system. In this case -Qi did the trick, and i was able to extract them with the above command. big_smile

So you don't really want something like http://archlinux.org/packages/extra/i686/qt/. Oh well, glad you found what you need.

Offline

#8 2010-11-12 20:52:02

trusktr
Banned
From: .earth
Registered: 2010-02-18
Posts: 907
Website

Re: [SOLVED] How to see what packages depend on a specified package?

Well either way in each scenerio you can isolate just the packages:
For system-installed packages:

pacman -Qi qt | grep "Req" | sed -e 's/Required By    : //g'

And for all repo packages:

pacman -Sii qt | grep "Req" | sed -e 's/Required By    : //g'

joe@trusktr.io - joe at true skater dot io.

Offline

#9 2016-12-19 11:32:12

kohtogeiya
Member
Registered: 2016-12-19
Posts: 1

Re: [SOLVED] How to see what packages depend on a specified package?

For posterity and all that, I'm replying to this 6 year old post.

At the time the above posts were probably the best answer, but now there exists a nice tool to directly extract data from pacman's alpm database instead of grepping and sedding stdout. The tool's called expac and in OP's case could be used like below if the qt package still existed:

$ expac -S %N qt

or if you only wanted to get local dependencies:

$ expac %N qt

Offline

#10 2016-12-19 11:55:08

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,846
Website

Re: [SOLVED] How to see what packages depend on a specified package?

Thanks for sharing, kohtogeiya, but please note that expac is extensively documented on the pacman tips and tricks wiki page already. You don't need to resurrect long-since-solved topics to update them.

Closing.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB