CentOS – find packages provided by repositories

A quick note to myself… This is what I do when I need to find which packages are provided by a certain repository. First I update the list of the available packages:

# yum check-update

Then I do a listing of them (bold is mine):

# yum repolist
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* base: mirrors.prometeus.net
* epel: fr2.rpmfind.net
* extras: mirrors.prometeus.net
* updates: mirrors.prometeus.net
Excluding Packages from CentOS-5 - Base
Excluding Packages from CentOS-5 - Updates
repo id repo name status
base CentOS-5 - Base 3,612+29
epel Extra Packages for Enterprise Linux 5 - x86_64 7,241
extras CentOS-5 - Extras 266
updates CentOS-5 - Updates 95
repolist: 11,214

At this point, if I need to find what packages are provided by the EPEL repository and write that list on a file, I’ll simply digit:

# rpm -qa | grep epel > epel-list.txt

Pulp – Juicy software repository management

via pulpproject.org

Pulp is a Python application for managing software repositories and their associated content, such as packages, errata, and distributions. It can replicate software repositories from a variety of supported sources, such as http/https, file system, ISO, and RHN, to a local on-site repository. It provides mechanisms for systems to gain access to these repositories, providing centralized software installation.

July 2010: CentOS is now the most popular Linux distribution on web servers

CentOS is a well known Linux distribution with a strong focus on server machines rather than on desktop PCs. For the first time, CentOS is now leading the Linux distribution statistics on web servers with almost 30% of all Linux servers.

migration from RHEL to CentOS, done!

Last year at work we brought a little server … you know, fiberchannel hard disks, 32GB of RAM, four quad core XEON … usual stuff ;-)
We also got a 1 year of Red Hat Enterprise Linux subscription. Obviuosly this year the money for a renewal of it’s licence aren’t available so, to keep safe and up-2-date, what do we do?

features rhel

We’ve decided to migrate to CentOS, given their famous binary compatibility with the Prominent North American Enterprise Linux Vendor ;-) Thanks to the Lord the process was simple and straightfoward as shown on the page of the official CentOS’ wiki.

Even with the subscription to RHN out-of-date, I did manage to upgrade r5.4 to 5.5 … the process cleaned ALL the official RedHat’s repo files from /etc/yum.repos.d … so beware, make a backup copy of them.

Then I’ve disabled the (few) 3rd party repo sources from my system (they are currently just adobe, epel and remi).

At this point I’ve followed the advice to disable first, and remove later, the yum’s rhnplugin since some CentOS’s forum user issued some warning or error if that was not done. Hence the following commands sequence was given (as root):

cp /etc/redhat-release /etc/redhat-release-saved
rpm -e --nodeps redhat-release-notes redhat-release yum-rhn-plugin redhat-logos

We’ve nearly there … I’ve manually downloaded on the system the three packages: centos-release, centos-release-notes and redhat-logos-X.X.XX-XX.el5.centos.noarch.rpm from the nearest (and fastest) distribution mirror available (they are placed in the ../5/os/$YOUR-ARCH/CentOS/ directory, by the way) and then manually installed with plain old rpm.

yum update

completed the process and here we are:


[root@localhost ~]# cat /etc/issue
CentOS release 5.5 (Final)
[root@localhost ~]# uname -a
Linux localhost 2.6.18-194.3.1.el5 #1 SMP Sun May 2 04:17:42 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux


upgrade RHEL/CentOS keeping old kernels

Today I’ve updated my RHEL 5.4 server, doing so it asked me to remove the oldest kernel.
This was due to a parameter in the yum.conf file:

installonly_limit = 3

Editing this to 5 I’ve safely keeped the oldest one needed by my hardware configuration.

Posted via email from TAKE FIVE

upgrading PHP and MySQL on CentOS via the Remi’s repo

A quick reminder to myself on the things to do when you decide to upgrade PHP (and subsequently MySQL for a “nasty” php-mysql dependency problem) on a stock, running CentOS / RHEL server.

You can encounter a number of errors like this

ERROR 1146 (42S02): Table ‘mysql.servers’ doesn’t exist

when you do a simple FLUSH PRIVILEGES; command or worst.

The solution that has worked for me, and that you HAVE to do each time you upgrade (manually, via RPM or DEB) the MySQL server is to launch this command BEFORE you do anything else:

/usr/bin/mysql_fix_privilege_tables --password=$your-mysql-root-password

Another solution could be the one explained here, but on my servers the before mentioned command worked smoothly!

enable Java plugin on Firefox with CentOS or RHEL (64bit)

centos logo During last weeks I’ve installed and configuread a 64bit RHEL server, paying attention to include the open source java-openJDK and the official Sun’s JRE.

This morning a colleague called me via skype telling me that his Firefox didn’t have a proper Java plugin installed. At first glance I didn’t knew what to do and the first results of a Google’ session were useless refferring to old incompatibility between a 64bit Firefox and 32bit java vitual machine, old releases of both softwares, wrong *.so files to include.

Google and google I found this post, pointing the focus on the libnpjp2.so file which, on my machine, is placed under the /usr/java/jre1.6.0_16/lib/amd64/libnpjp2.so path.

So I went to /usr/lib64/firefox-3.0.14/ folder {ignoring the old ones visible on the directory}, created a sub-directory called plugins (as root) and gave the command:

ln -s /usr/java/jre1.6.0_16/lib/amd64/libnpjp2.so libnpjp2.so

The I restarted Firefox and once loaded went to the Java Test Page to check my virtual machine installation and witnessed the correct, and aspected, result:

Your Java configuration is as follows:
Vendor: Sun Microsystems Inc.
Version: Java 6 Update 16
Operating System: Linux 2.6.18-164.2.1.el5
Architecture: amd64

Hope this will be useful to you too!

RHEL, failed to add iptables rule to allow DHCP requests from ‘virbr0’

I’ve just updated my RHEL 5.3 box with the last months’ updates moving it to the 5.4 release.

Just after the yum update finished I’ve begun to receive a LOT of messages containing:

OBJECT: python /usr/share/rhn/virtualization/poller.py
BODY: libvir: QEMU error : failed to add iptables rule to allow DHCP requests from 'virbr0' : Invalid argument

The solution to that, after a yum whatprovides "*/poller.py" was to remove any instance of the rhn-virtualization-host package from my machines (since I do not have any virtualization need).


Nagios is RedHat’s Standard Alerting System

Download Music and Movies USA Media Download Music Download Video


The Nagios Community is happy to inform that Nagios is used as RedHat’s standard alerting system. Nick Otto gave a presentation at the RedHat Summit in Chicago earlier this month, in which he covers Nagios and other great OSS tools that are used inside one of the front-runners in commercial Open Source.



Read more on func.et.redhat.com

Func is a secure, scriptable remote control framework and API. It is intended to replace SSH scripted infrastructure for a variety of datacenter automation tasks (such as taking hardware inventory, running queries, or executing remote commands) that are run against a large amount of systems at the same time.

restore grub installation [Fedora, Centos, RHEL & derivates]

Have you ever found yourself with a non-booting GNU/Linux box?
If the cause is a corrupted grub installation (by a bad move on kernel upgrade, a Windows update or whatever) all you have to do is simply:

  • set the BIOS of your machine to have CD/DVD-rom player as the 1st boot device; 
  • insert the Fedora/CentOS/RHEL media on it and boot the system, 
  • choose {or manually insert}: linux rescue and press return, 
  • a number of messages will be displayed until you will be taken to a working shell and your old system is mounted on /mnt/sysimage path, 
  • give ‘chroot /mnt/sysimage‘ command to “phisically translate” the shell on your original installation 
  • cd /boot/grub‘ 
  • then check where grub results installed if you have different disks on your machine with a grep ‘#boot’ grub.conf 
  • read the output, verify it’s correct eventually with the help of an fdisk -l command, 
  • now you are ready to install grub, after you’ve choosen the device (or partition) where it sould is located give the command grub-install /dev/device-choosen {ie that could be /dev/sda} 
  • now close the shell and reboot, the system should be working correctly now! 

Enjoy ;-)