Other languages Deutsch ; English ; Français ; |
Synopsis: A source RPM (SRPM) can contain many separate rpm packages. The packages held within it do not necessarily relate to the name of their source rpm. It is important to know how to find the SRPM for a package. There are several ways to find out. |
Contents
Search among installed packages by name
If you have a package installed you can use the command
$ rpm -qi <package name>
For example:
$ rpm -qi firefox Name : firefox Epoch : 0 Version : 10.0.4 Release : 1.mga2 Architecture: i586 Install Date: Don 31 Mai 2012 00:41:53 CEST Group : Networking/WWW Size : 36113009 License : MPLv1+ Signature : RSA/SHA1, Son 22 Apr 2012 11:45:08 CEST, Key ID b742fa8b80420f66 Source RPM : firefox-10.0.4-1.mga2.src.rpm Build Date : Son 22 Apr 2012 11:28:47 CEST Build Host : jonund.mageia.org Relocations : (not relocatable) Packager : tmb <tmb> Vendor : Mageia.Org URL : http://www.mozilla.com/firefox/ Summary : Next generation web browser Description : The award-winning Web browser is now faster, more secure, and fully customizable to your online life. With Firefox(R), we've added powerful new features that make your online experience even better. It is an 'open source' product which is freely available, and is acquiring a growing proportion of international web browser usage. Firefox claims to offer a more secure web browsing experience than other products, with better protection against spyware and other Internet-based security threats. It includes all the standard features of a modern web browser, like Internet searching, tracking recently visited sites, setting up shortcuts to favourite sites, customising the software behaviour and so on. Firefox also includes features like 'tabbed browsing' (opening several web sites as sections within the same window) and methods for controlling pop-up windows, cookies and downloaded files.
This output shows you that the SRPM firefox-10.0.4-1.mga2.src.rpm is currently installed on your system.
Search among installed packages by path
If you wish to find out what provides a certain file on your system you can use the command
$ rpm -qif </path/to/filename.ext>
This is especially useful for unfamiliar files.
For example:
$ rpm -qif /usr/lib/libass.so.4 Name : libass4 Relocations: (not relocatable) Version : 0.9.11 Vendor: Mageia.Org Release : 3.mga1 Build Date: Sun 16 Jan 2011 18:54:29 GMT Install Date: Sat 04 Jun 2011 17:09:47 BST Build Host: ecosse Group : System/Libraries Source RPM: libass-0.9.11-3.mga1.src.rpm Size : 108260 License: GPLv2+ Signature : RSA/SHA1, Fri 11 Feb 2011 21:49:01 GMT, Key ID b742fa8b80420f66 Packager : Mageia Team <http://www.mageia.org> URL : http://code.google.com/p/libass/ Summary : Shared library for SSA/ASS subtitles rendering Description : Libass is a portable library for SSA/ASS subtitles rendering. $ rpm -qif /usr/bin/firefox Name : firefox Relocations: (not relocatable) Version : 7.0.1 Vendor: Mageia.Org Release : 0.1.mga1 Build Date: Fri 30 Sep 2011 03:10:56 BST Install Date: Sat 01 Oct 2011 16:01:33 BST Build Host: jonund Group : Networking/WWW Source RPM: firefox-7.0.1-0.1.mga1.src.rpm Size : 33911286 License: MPLv1+ Signature : RSA/SHA1, Fri 30 Sep 2011 03:30:12 BST, Key ID b742fa8b80420f66 Packager : Mageia Team <http://www.mageia.org> URL : http://www.mozilla.com/firefox/ Summary : Next generation web browser Description : The award-winning Web browser is now faster, more secure, and fully customizable to your online life. With Firefox(R), we've added powerful new features that make your online experience even better. It is an 'open source' product which is freely available, and is acquiring a growing proportion of international web browser usage. Firefox claims to offer a more secure web browsing experience than other products, with better protection against spyware and other Internet-based security threats. It includes all the standard features of a modern web browser, like Internet searching, tracking recently visited sites, setting up shortcuts to favourite sites, customising the software behaviour and so on. Firefox also includes features like 'tabbed browsing' (opening several web sites as sections within the same window) and methods for controlling pop-up windows, cookies and downloaded files.
If you want to know the path to an application, use the $ which command which searches all directories in your path.
$ which firefox /usr/bin/firefox
Alternatively you can use the command described above.
Search any package on all media
This works whether you have the package installed or not:
$ urpmq -i <package name>
$urpmq -i kontact Name : kontact Version : 4.4.11.1 Release : 2.1.mga1 Group : Graphical desktop/KDE Size : 997979 Architecture: i586 Source RPM : kdepim4-4.4.11.1-2.1.mga1.src.rpm URL : http://pim.kde.org Summary : Kontact Container Description : The KDE Kontact Personal Information Management suite unites mature and proven KDE applications under one roof. Thanks to the powerful KParts technology, existing applications are seamlessly integrated into one.
In this example, "$ urpmq -i kontact" above shows the SRPM of kontact-4.4.11.1-2.1.mga1 to be kdepim4-4.4.11.1-2.1.mga1.src.rpm.
Note: "urpmq -i <package name>" will search on all media enabled on your system and output all packages. So if there was already an update to a package, the output will look like this (provided you didn't disable Core Updates):
$ urpmq -i sudo Name : sudo Version : 1.8.3p2 Release : 1.mga2 Group : System/Base Size : 1785410 Architecture: i586 Source RPM : sudo-1.8.3p2-1.mga2.src.rpm URL : http://www.sudo.ws/sudo Summary : Allows command execution as root for specified users Description : Sudo is a program designed to allow a sysadmin to give limited root privileges to users and log root activity. The basic philosophy is to give as few privileges as possible but still allow people to get their work done. Name : sudo Version : 1.8.3p2 Release : 2.mga2 Group : System/Base Size : 1785710 Architecture: i586 Source RPM : sudo-1.8.3p2-2.mga2.src.rpm URL : http://www.sudo.ws/sudo Summary : Allows command execution as root for specified users Description : Sudo is a program designed to allow a sysadmin to give limited root privileges to users and log root activity. The basic philosophy is to give as few privileges as possible but still allow people to get their work done.
On the other hand, if an update candidate is awaiting validation in Core Updates Testing and you have this media enabled on your system, the output may look like this:
$ urpmq -i thunderbird Name : thunderbird Version : 10.0.5 Release : 1.mga2 Group : Networking/Mail Size : 38480057 Architecture: i586 Source RPM : thunderbird-10.0.5-1.mga2.src.rpm URL : http://www.mozilla.org/en-US/thunderbird/organizations/all-esr.html Summary : Full-featured email, RSS, and newsgroup client Description : Mozilla Thunderbird is a full-featured email, RSS and newsgroup client that makes emailing safer, faster and easier than ever before. Name : thunderbird Version : 10.0.4 Release : 1.mga2 Group : Networking/Mail Size : 38481635 Architecture: i586 Source RPM : thunderbird-10.0.4-1.mga2.src.rpm URL : http://www.mozilla.org/en-US/thunderbird/organizations/all-esr.html Summary : Full-featured email, RSS, and newsgroup client Description : Mozilla Thunderbird is a full-featured email, RSS and newsgroup client that makes emailing safer, faster and easier than ever before.
Note: If you have several media enabled, urpmq -i does not indicate where a package comes from. If this information matters to you, read on to find out how to search more effectively.
Search any package on a specific media
As mentioned above, "urpmq -i <package name>" searches a package on all media enabled on your system. To limit the search to just one media, use
urpmq -i --media "<Core Release/Core Updates/Core Updates Testing>"
For the sake of clarity, the following examples are from the same system as the ones used in the #Search any package on all media section.
$ urpmq -i --media "Core Release" sudo Name : sudo Version : 1.8.3p2 Release : 1.mga2 Group : System/Base Size : 1785410 Architecture: i586 Source RPM : sudo-1.8.3p2-1.mga2.src.rpm URL : http://www.sudo.ws/sudo Summary : Allows command execution as root for specified users Description : Sudo is a program designed to allow a sysadmin to give limited root privileges to users and log root activity. The basic philosophy is to give as few privileges as possible but still allow people to get their work done.
$ urpmq -i --media "Core Updates" sudo Name : sudo Version : 1.8.3p2 Release : 2.mga2 Group : System/Base Size : 1785710 Architecture: i586 Source RPM : sudo-1.8.3p2-2.mga2.src.rpm URL : http://www.sudo.ws/sudo Summary : Allows command execution as root for specified users Description : Sudo is a program designed to allow a sysadmin to give limited root privileges to users and log root activity. The basic philosophy is to give as few privileges as possible but still allow people to get their work done.
This output shows you that SRPM sudo-1.8.3p2-1.mga2.src.rpm was released with Mageia 2. Later on an update was pushed, namely SRPM sudo-1.8.3p2-2.mga2.src.rpm.
$ urpmq -i --media "Core Release" thunderbird Name : thunderbird Version : 10.0.4 Release : 1.mga2 Group : Networking/Mail Size : 38481635 Architecture: i586 Source RPM : thunderbird-10.0.4-1.mga2.src.rpm URL : http://www.mozilla.org/en-US/thunderbird/organizations/all-esr.html Summary : Full-featured email, RSS, and newsgroup client Description : Mozilla Thunderbird is a full-featured email, RSS and newsgroup client that makes emailing safer, faster and easier than ever before.
$ urpmq -i --media "Core Updates Testing" thunderbird Name : thunderbird Version : 10.0.5 Release : 1.mga2 Group : Networking/Mail Size : 38480057 Architecture: i586 Source RPM : thunderbird-10.0.5-1.mga2.src.rpm URL : http://www.mozilla.org/en-US/thunderbird/organizations/all-esr.html Summary : Full-featured email, RSS, and newsgroup client Description : Mozilla Thunderbird is a full-featured email, RSS and newsgroup client that makes emailing safer, faster and easier than ever before.
thunderbird-10.0.4-1.mga2.src.rpm was released with Mageia 2, while thunderbird-10.0.5-1.mga2.src.rpm is currently an update candidate.
More information
If you need more extensive information, a good source are the man pages:
$ man urpmq
$ man rpm