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

how-to fix the XS version of Scalar::Util error in CentOS / RHEL / Fedora

It’s being some month now that at work we have encountered a nasty problem with Perl’s module Compress::Zib usage in a tool developed by a colleague. At the moment to start the graphical rendering of a web page the system gave error to our users.

Searching in Apache2’s log I’ve encoutered many error of this kind:

dualvar is only available with the XS version of Scalar::Util at /var/www/html/$MY-APP-PATH/perl/Compress/Zlib.pm line 8

This is because the Scalar-List-Utils module precompiled in RHEL/Fedora/CentOS and similar does NOT have the support of XS weaken function.

You will see a lot of bugs issued on this topic in this part of Linux distro’s.

My solution was to install perl-Task-Weaken package:

In fact as we can read in the package’s description:

rpm -qi perl-Task-Weaken
URL         : http://search.cpan.org/dist/Task-Weaken/
Summary     : Ensure that a platform has weaken support
Description :
One recurring problem in modules that use Scalar::Util's weaken function is
that it is not present in the pure-perl variant.

This restores the functionality testing to a dependency you do once in
your Makefile.PL, rather than something you have to write extra tests
for each time you write a module.

Happy coding!

Error booting Fedora in VirtualBox

I am in the middle of the work for a GNU/Linux keynote & hands-on demo for some colleagues.

Since I’m a loyal Fedora/CentOS user I’m installing the latest Fedora 15 on my MacBook’s VirtualBox.

Fedora screenshots

Everything went ok during the installation until first reboot on which the system told me:


remaining into the error mode and forcing me to manually reboot.

If this happens to you too be sure to check if the installation media (the cd-rom or the dvd-rom) is still present in the player (!!!) and remove it.

It happears to be a know issue with VirtualBox, since a bug #2680 was opened 3 years ago and still unresolved (probably because it’s unclear if it’s VirtualBox or Fedora dvd boot system fault).
Ejecting the optical media solved my issue, cheers!

how to install RMySQL on CentOS

A quick note for who have the need of installing RMySQL on CentOS (or RHEL).

On my system R is installed via the EPEL repository (as I’ve added in the comments of this post of this very blog).

Given this I went to the RMySQL project page and downloaded both the RMySQL_0.7-5.tar.gz and the (required) DBI_0.2-5.tar.gz packages.

This because installing the R-DBI package provided by the activated repository on my system gave me errors during the actual RMySQL installation.

So, as root – since the installation was needed system-wide – i gave those two following commands:

[root@testing ~]# R CMD INSTALL DBI_0.2-5.tar.gz
[root@testing ~]# R CMD INSTALL RMySQL_0.7-5.tar.gz

Then all the user needed to do was loading into his R environment the new modules!
Happy coding!

For future reference:

  • CRAN – RMySQL package
  • CRAN – DBI package

What files are provided by $package.rpm?

Today I needed to install the openMPI package on a development machine, and occurred to me to know if by installing it the system’s GCC (and similar). So asked my friend Gianluca an hand and he pointed me to the repoquery command.

So I did the following:

yum whatprovides "*/repoquery"

which gived to me:

yum-utils-1.1.16-14.el5.centos.1.noarch : Utilities based around the yum package manager
Repo : base
Matched from:
Filename : /usr/bin/repoquery

so I did a simple:

yum install yum-utils

followed by a:

repoquery -ql openmpi-devel.x86_64

… and I obtained the needed infos. Thanks Gianluca!

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


CentOS Release 5.5 i386 and x86_64

The [CentOS] x86_64 DVD set is now spread over 2 DVD isos, while the i386 DVD remains as 1 iso file. We’ve had to split the x86_64 dvd media over multiple disks due to the increase in the binary packages size. We have, however, tried to build them in a way that dvd#1 should be all that is needed by most people. x86_64 DVD#2 is limited to some OpenOffice.org language packages.
x86_64 DVD#1 includes the rest of the distro and also includes the most popular OpenOffice.org language packs. More details on the exact split are available in the Release Notes.

via lists.centos.org

Git on CentOS 5

I’ve been hearing good things about git lately, with many projects which used to use subversion converting to it, so I’ve decided to try it out myself. RPMForge only has version 1.5, so like the other software I’ve been using, I’ve converted Fedora 11’s rpm to CentOS and put it in the Webtatic repository.

If you haven’t set up the Webtatic repository in yum, then add it in the command-line as following:

rpm -ivh http://repo.webtatic.com/yum/centos/5/`uname -i`/webtatic-release-5-0.noarch.rpm

Now install git:

yum install --enablerepo=webtatic git-all

via webtatic.com

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!