[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Check if a repository is being used?

Verily I say unto thee, that Stanczak Group spake thusly:

> If you have a couple different repositories and you'd like to remove 
> one, is there a way to see if there are any packages on your system
> that are from the repository?

If the repo you were thinking about removing was, e.g. Livna, then:

rpm -qa --qf "%{vendor} : %{buildhost} : %{name}\n" | grep -i livna

Would show you all packages where either the Vendor or Buildhost string
was Livna.

The ":" colons are purely arbitrary; you can format the output any way
you like. If you do:

rpm -q --querytags

That will show you all the available "tag" strings that you can specify
in the --qf search, i.e. "%{whatevertag}". Don't forget the newline
escape "\n" at the end, or you'll end up with a huge one-liner.

If you're not sure what the proper Vendor string is likely to be, then
you could look through all of them with:

rpm -qa --qf "%{vendor} : %{buildhost} : %{name}\n" | sort | less

Or even eliminate known repos from your "search" with:

rpm -qa --qf "%{vendor} : %{buildhost} : %{name}\n" | grep -vi "red hat"

You get the idea.



| "Computer games don’t affect kids, I mean if Pac man affected us as
| kids, we’d all be running around in darkened rooms, munching pills
| and listening to repetitive music." - Kristian Wilson, Nintendo

Fedora release 7 (Moonshine) on sky, running kernel 2.6.21-1.3194.fc7
 02:55:34 up 6 days,  1:49,  3 users,  load average: 0.70, 0.46, 0.45

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]