What files comprise an RPM package? Which package a file belongs to?
If you want to find the relationship between files on your system and RPM packages (which one owns/belongs-to which) then this page will be of help to you.
1. Contents of an RPM package
1.1.1. This RPM command will show you the contents of a package which is already installed on your system:
rpm -ql <package-name.rpm>
For example: rpm -ql skype
will list all the files that the skype package installed onto your system. Note that you don’t need to give the exact name of the package (like skype-2.0.0.72-fc5.i586 in my case). Of course giving the exact name of the package will also work (provided you type it correctly).
1.1.2 Here’s how to find the contents of an rpm package which is NOT yet installed (i.e. all the files inside the package, and where they will be installed):
rpm -qpl <path/to/file.rpm>
1.2. Which RPM package this file belongs to?
The below command will tell you what RPM package installed a given file onto your machine, i.e. what RPM package the file belongs to or which package “owns” the file (note that the file MUST be already installed for this to work):
rpm -qf /bin/bash
Try this on your system (must have bash :)) and you should see the rpm command output the name of the bash package, something like bash-3.2-23.fc9.i386
3 Responses to What files comprise an RPM package? Which package a file belongs to?
Leave a Reply Cancel reply
-
Categories
- Android Development
- Bash
- C programming
- dpkg/apt-get
- drupal
- Emacs
- Git
- Java
- Linux administration
- Linux device drivers
- Linux Gaming
- Linux kernel
- Linux Networking
- Linux on Windows
- Linux printing
- Linux sound and ALSA
- Package Managers
- Programming
- RPM
- Shell and environment
- Tips and tricks
- Uncategorized
- VirtualBox
- Virtualization
- web development
- wine
- WMaker
- Wordpress Tips
- X Window System
- XFCE
-
Articles
- August 2020
- August 2019
- May 2019
- July 2017
- February 2017
- January 2017
- November 2016
- October 2016
- September 2016
- August 2016
- July 2016
- June 2016
- April 2016
- March 2016
- December 2015
- November 2015
- September 2015
- June 2015
- May 2015
- April 2015
- March 2015
- February 2015
- January 2015
- December 2014
- October 2014
- February 2014
- January 2014
- November 2013
- October 2013
- June 2013
- April 2013
- March 2013
- February 2013
- January 2013
- December 2012
- October 2012
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- February 2012
- September 2011
- August 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
-
Meta
Cloud
audio bash boot compile C programming cups drupal emacs etc Fedora git grep how to httpd init kernel libc linux linux partition localtime login make mount mp3 mysql networking oracle package managers password phpMyAdmin programming rpm shell sql vbox version control system virtual box vm web server wordpress www xargs xfce xwin yum
Often a poorly packaged app would miss a dependency – usually an shared object library (a .so file). In such cases you’d see an error like:
/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
So in this case it would be nice to find out which packages provides the ld-linux.so.2 file.
$ yum whatprovides ld-linux.so.2
glibc-2.14.90-14.i686 : The GNU libc libraries
Repo : fedora
Matched from:
Other : ld-linux.so.2
This tells us that the ld-linux so lib is provided by the glibc library. Note that you must give the exact so name to yum whatprovides, whereas when installing you may just type yum install glibc and it will find the correct version.
(Note: yum is Fedora’s package manager / frontend to the rpm command)
This is how you can list all the packages installed on your system:
yum list installed
The resulting list of packages will be quite long so if you have an idea what you’re looking for (e.g. if you looking for all the “ncurses” packages) you may do something like:
yum list installed | grep ncurses
And using dnf:
As you can see, in this case the pkg-config command is provided by both the @System and Updates repos.
– – – – –
Another similar and VERY useful command would be:
This will show you which version of the package (firefox in this example) is installed on your computer, if any, and which versions (higher AND lower) are available.
This way, if you need to, you could downgrade a package! In this particular case this is what the command output for me: