top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to switch a directory in the yum list?

+4 votes
563 views

When I do a yum list installed and I get a list of the installed packages for the local system.

However, I have no idea where this data is coming from, is it coming from the
/var/lib/rpm ,
/var//lib/yum/yumdb

or perhaps somewhere else? Is there a switch I could use to change the db, or to point to a different yumdb/dir?

I've got a drive from a separate/older system that I'd like to mount/examine to see what packages where installed with yum on that drive...

the "installroot" switch appears to be used to chroot into a separate location for the yum.repos.d" - but I could be wrong..

posted Jan 2, 2014 by Naveena Garg

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

You can use rpm directly for simplicity:

% rpm -q fedora-release
fedora-release-20-1.noarch
% sudo mount /dev/mapper/fedora-f19-root /mnt/f19
% rpm --root=/mnt/f19 -q fedora-release
fedora-release-19-4.noarch

yum --installroot should work similarly.

answer Jan 3, 2014 by Salil Agrawal
Similar Questions
0 votes

Given a list of rpms on one system (rpm -qa > list.txt), is there a one-shot command that I can run on another system to remove all of the rpms not listed and add any that are on the list and not present on the second system?

+2 votes

I have a small problem with some packages : I was doing an update over ssh and my connection was interrupted .. now i have a lots of duplicates and if i try to remove them, yum tries to uninstall all system (447 packages 1.4 gb)

Any idea how can I clean this mess? It would be pretty bad if the machine needs to be re-installed only because the connection went bad during the process...

...