Total Pageviews

Friday, 23 October 2009

RHEL 5 yum info does not report "installed-from repo"

This is a normal behaviour, yum, doesn't keep a record between repo and package, that we can easily query once installed, therefore yum info does not report "installed-from repo".

We can only see

repo: installed

instead of

repo: fedora.

If you would like to see which packages have been installed from which repo you could issue the following command :

1) if we needed to know what pakacges have been installed from fedora repo :

yum --disablerepo=* --enablerepo=fedora list | grep -v "installed" | grep package

[root@localhost ~]# yum --disablerepo=* --enablerepo=fedora list | grep -v "installed" | grep package
Loaded plugins: refresh-packagekit
fedora-package-config-apt.noarch 11-4 fedora
fedora-package-config-smart.x86_64 11-17 fedora
fedora-packager.noarch 0.3.3-1.fc11 fedora
fontpackages-devel.noarch 1.20-2.fc11 fedora
gnome-packagekit-extra.x86_64 2.27.2-0.2.20090414git.fc11 fedora
kdeadmin-kpackage.x86_64 7:4.2.2-4.fc11 fedora
ruby-gettext-package.noarch 2.0.0-1.fc11 fedora
xemacs-packages-base.noarch 20090217-1.fc11 fedora
xemacs-packages-base-el.noarch 20090217-1.fc11 fedora
xemacs-packages-extra.noarch 20090217-1.fc11 fedora
xemacs-packages-extra-el.noarch 20090217-1.fc11 fedora
xemacs-packages-extra-info.noarch 20090217-1.fc11 fedora
yum-plugin-protect-packages.noarch 1.1.21-2.fc11 fedora

[root@localhost ~]# yum --disablerepo=* --enablerepo=fedora list | grep -v "installed" | grep kdeadmin
kdeadmin.x86_64 7:4.2.2-4.fc11 fedora
kdeadmin-kpackage.x86_64 7:4.2.2-4.fc11 fedora

2) Also another possibility is to create an alias on .bashrc called fedorarepo, for example :

# alias fedorarepo='yum --disablerepo=* --enablerepo=fedora list | grep -v "installed"' | grep package

[root@localhost ~]# fedorarepo
Loaded plugins: refresh-packagekit
fedora-package-config-apt.noarch 11-4 fedora
fedora-package-config-smart.x86_64 11-17 fedora
fedora-packager.noarch 0.3.3-1.fc11 fedora
fontpackages-devel.noarch 1.20-2.fc11 fedora
gnome-packagekit-extra.x86_64 2.27.2-0.2.20090414git.fc11 fedora
kdeadmin-kpackage.x86_64 7:4.2.2-4.fc11 fedora
ruby-gettext-package.noarch 2.0.0-1.fc11 fedora
xemacs-packages-base.noarch 20090217-1.fc11 fedora
xemacs-packages-base-el.noarch 20090217-1.fc11 fedora


Each time we issue the fedorarepo command will list packages installed by the fedora repository, we could create this alias for
all our repos eg.

# alias fedorarepo='yum --disablerepo=* --enablerepo=fedora list | grep -v "installed"' | grep package
# alias epelrepos='yum --disablerepo=* --enablerepo=epel list | grep -v "installed"' | grep package

Creating alias could be really useful as we could pipe the input and grep the name of the package.

Jesus Bustos

No comments: