4

When you use yum info to find details for a selected package, it lists the repo as "installed". That's all well and good, but for installed packages, I want to know which repository it is installed from, so that I can be sure to install any related packages from the same repository.

$: yum info mysql-server
Loaded plugins: fastestmirror
Installed Packages
Name       : mysql-server
Arch       : x86_64
Version    : 5.0.77
Release    : 4.el5_6.6
Size       : 22 M
Repo       : installed
Summary    : The MySQL server and related files.
URL        : http://www.mysql.com
License    : GPLv2 with exceptions
Description: MySQL is a multi-user, multi-threaded SQL database server. MySQL is a
           : client/server implementation consisting of a server daemon (mysqld)
           : and many different client programs and libraries. This package contains
           : the MySQL server and some accompanying files and directories.

How do I find out which repository this specific package was installed from?

3

Modern versions of YUM provide this information.

For instance, on my Fedora 15 system with YUM 3.2.29:

# yum info mysql-server
Loaded plugins: fastestmirror, langpacks, presto, refresh-packagekit
Installed Packages
Name        : mysql-server
Arch        : x86_64
Version     : 5.5.14
Release     : 2.fc15
Size        : 42 M
Repo        : installed
From repo   : updates
Summary     : The MySQL server and related files
URL         : http://www.mysql.com
License     : GPLv2 with exceptions
Description : MySQL is a multi-user, multi-threaded SQL database server. MySQL is a
            : client/server implementation consisting of a server daemon (mysqld)
            : and many different client programs and libraries. This package contains
            : the MySQL server and some accompanying files and directories.

You might see if there is a newer version of YUM that provides this information available for your system.

  • 1
    I was looking for the same information. So, FWIW: the From repo field has been introduced in yum-3-2-23~76, which then made into Fedora 11 or 12. With dnf, the field is called Repo again. – ckujau Dec 14 '17 at 11:24
2

An updated - slightly more useful - answer, for those who were as unfortunate as I was to have stumbled upon this...

For Fedora (and presumably Centos & RHEL) e.g.:

dnf whatprovides postgresql-server

Using metadata from blah blah blah

postgresql-server-9.3.9-1.fc21.x86_64 : The programs needed to create and run a PostgreSQL server

Repo        : @System

postgresql-server-9.3.5-4.fc21.x86_64 : The programs needed to create and run a PostgreSQL server

Repo        : fedora

postgresql-server-9.3.9-1.fc21.x86_64 : The programs needed to create and run a PostgreSQL server

Repo        : updates

As you can see, it lists @System for the package that's currently installed, as well as from what repos and versions it could possibly be installed from. The important part here thou, is the last item listed, the version details and name of which match what's installed exactly. It was therefore installed from the fedora updates repository. Dnf, like yum, also supports the info option, i.e.:

dnf info postgresql-server

However, on my system, the dnf output does not display the From repo field, unlike the yum command, so YMMV.

0

The best way to determine this is from the package signing key for each package. There wasn’t a simple way to do this, so someone created the program Keychecker.

This little script grew from a conversation about how to effectively identify the repository of origin for an RPM installed on a system. The closest thing that the RPM database stores to this is the GPG key used to sign the package. This script looks at the keys used, and prints them either in a list format, or in csv (if invoked with the -m option). People liked it, so here it is released to a broader audience :)

It is available via EPEL. It will output all your installed packages, grouped by the key they were signed by. The key description will make it clear what repo it is from. Any reputable repository will be signing their packages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.