System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Source / rpm package location

Kennedy G. Doss
Regular Advisor

Source / rpm package location

Linux Admins:

I am curious to know if there is a way of finding the source of an rpm package which is already installed on a RHEL server. On HP-UX I use the command "swlist -v | grep -i source" to get the name/location of the depot file. I am sure there is a way to get this information on a Linux server too. Any input from your end would be most appreciated.
3 REPLIES
Steven E. Protter
Exalted Contributor

Re: Source / rpm package location

Shalom,

rpm -qa

See the man page for other listing options.

rpm can do almost anything that swlist does.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Kennedy G. Doss
Regular Advisor

Re: Source / rpm package location

Shalom to you too, Steve.

Thanks for taking the time and writing back to me. I am still looking for answers for this question. I am aware of rpm -qa. Before shooting this question, I looked at man pages and did not find a similar option which gives the source of the depot or rpm file for any given package. Please send me any ideas to grab this piece of information.
Matti_Kurkela
Honored Contributor

Re: Source / rpm package location

Source? Like, the name of the RPM?

By RedHat standard practice, the RPM filename of is always -.rpm.

The command

rpm -qi

can be used to get the package metadata information, which may include the URL where the package's source code is available.

The same information can be read from a RPM file with:

rpm -qip -.rpm

I don't think the RPM tool stores any information about where the RPM file came from into the installed RPM database; this would be the job for higher-level tools, like up2date (RHEL 4 and older) or yum (RHEL5 +).

By the time the "rpm" tool can begin the installation of a package, the package must already downloaded to the local system. Therefore, if the rpm command saved the package location information, it would often be a reference to the package management system's temporary directory, like "/var/lib/rpm/-.rpm".

MK
MK