You are not logged in.

#1 2010-11-10 20:18:06

enderwig
Member
Registered: 2008-10-15
Posts: 3

Pacman one liner, need help

What I am trying to accomplish is when pacman tells me I have an upgradable package, I want to list the other packages on my system that depend on that one before I upgrade.
I've spent hours going over the pacman and grep man pages and the best I have come up with so far is:

pacman -Qi | grep -6 Depends | grep -6 $upgradeablepkg 

For example, right now pacman says package dbus-glib has a new version available.  Before I upgrade, I would like to see a list of packages that may be effected before proceeding.  That really ugly line up there gives me 6 lines on either side of dbus-glib which inludes the package name line, then I get to scoll through it forever deciphering which packages are effected.  There has to be a better way, I just can't seem to figure it out myself, so I'm pleading for a little help from those more knowledgable than me.  All I really want for output is the name of the effected packages.
Thanks

Offline

#2 2010-11-10 20:36:04

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,799
Website

Re: Pacman one liner, need help

pacman -R $upgradablepackage --print

Last edited by brisbin33 (2010-11-10 20:39:23)

Offline

#3 2010-11-10 20:49:54

ber_t
Member
From: Berlin, Germany
Registered: 2010-03-10
Posts: 214
Website

Re: Pacman one liner, need help

Do you only want to see the packages which depend on the upgradable one? You can get them with this command:

pacman -Qi $upgradeablepkg | grep ^Required

Offline

#4 2010-11-10 21:11:59

enderwig
Member
Registered: 2008-10-15
Posts: 3

Re: Pacman one liner, need help

thanks everyone, they both work, but I think I'll stick with the one from ber_t just because I don't want to forget the "--print" in the first one!  I was approaching it backwards, never even looked at the Required line in pacman -Qi!  Thanks

Offline

#5 2010-11-10 21:41:40

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,799
Website

Re: Pacman one liner, need help

enderwig wrote:

but I think I'll stick with the one from ber_t just because I don't want to forget the "--print" in the first one!

just an fyi, even if you forget --print, pacman will ask for confirmation.

Offline

#6 2010-11-10 23:14:17

enderwig
Member
Registered: 2008-10-15
Posts: 3

Re: Pacman one liner, need help

If anyone cares, I stuck it in a function in .bashrc, works great!
Thanks again for the help.

function whatdeps() { pacman -Qi "$1" | grep ^Required;}

Offline

#7 2010-11-11 00:21:48

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Pacman one liner, need help

pactree (part of pacman-contrib) is great for this kind of stuff. Expect huge speed improvements in pacman 3.5 wink

Last edited by falconindy (2010-11-11 00:22:23)

Offline

Board footer

Powered by FluxBB