Tag Archives: RHEL4

Replace RPMforge packages with Redhats own on a RHEL5 system

This post came to life after experiencing some upgrade problems with missing dependencies and RPM packages from RPMforge and Redhat Enterprise Linux Client release 5. The prosess to remove or replace the packages was to remove RPMforge as a package repository and replace the blocking packages with Redhats own packages.

The process of replacing RPMforge packages with Redhats own packages
First we remove rpmforge as package repository

rpm -e rpmforge

This command removes the /etc/yum.repos.d/rpmforge.repo file.

Then we list all packages installed from the RPMforge repository to get an overview of the packages causing problems on the system.

rpm -qa --queryformat %{NAME}-%{VERSION}-%{ARCH}-%{RELEASE}\\n|sort|grep el5.rf

The result

dnsmasq-2.47-x86_64-1.el5.rf
libsndfile-1.0.17-x86_64-1.el5.rf
lftp-3.7.12-x86_64-1.el5.rf
...

The rf ending tells you that these packages are RPMforge packages. This command also tells you if it is 32bit (i386) or 64bit (x86_64) packages. I’ve described the prosess of removing 32- and 64bits packages in a earlier post named Remove duplicate packages when querying the rpm database.

Howto remove 64bit packages

yum remove libsndfile.x86_64

Next we will download the packages we want to replace, in my case dnsmasq

On a RHEL5 system

yumdownloader dnsmasq

If you don’t have yumdownloader in your system you have to install the yum-utils package.

On a RHEL4 system

up2date -d dnsmasq

Then we replace the RPMforge RPM package with Redhats own package

# rpm -Uvh --replacepkgs --oldpackage dnsmasq-2.45-1.el5_2.1.x86_64.rpm 
Preparing...                ########################################### [100%]
   1:dnsmasq                ########################################### [100%]

If you don’t use the –oldpackage option you might get an error message like this

package dnsmasq-2.47-1.el5.rf.x86_64 (which is newer than dnsmasq-2.45-1.el5_2.1.x86_64) is already installed

I continued removing RPMForge packages until yum managed to resolve any unresolved dependencies.

Disable IPv6 on Redhat RHEL4

First you remove this line from /etc/modprobe.conf if this line exists.

alias net-pf-10 ipv6

Add the following line to /etc/modprobe.conf

alias net-pf-10 off

Reboot the system. IPv6 is now disabled.

To re-enable IPv6, remove the alias net-pf-10 off line from /etc/modprobe.conf and reboot the machine.

I’ve also made a post about how to disable IPv6 on RHEL5.

Convert unix timestamp to date

# date -d @1221256800 "+%Y-%m-%d %T"
2008-09-13 00:00:00

Convert a date (YYYYMMDD) to unix timestamp

# date -d "20080913" +%s
1221256800

Remove duplicate packages when querying the rpm database

Today I had to solve a RPM problem on a Red Hat Enterprise Linux WS release 4 (Nahant Update 6) system (RHEL4) where there were duplicate packages when querying the rpm database. This had happened after an upgrade to update 6 using up2date from the command line.

It seemed like i386 and x64 packages had gotten installed on some packages and this caused some problems, like logon authentication and execution of some programs.

Trying to remove a duplicate rpm package

# rpm -e libtool-libs-1.5.6-4.El4.2

gave the error message

error: "libtool-libs-1.5.6-4.El4.2" specifies multiple packages

After searching the Red Hat knowledge base I located article Why do I see duplicate packages when querying the rpm database? where it says it is necessary to specify the architecture of the package to remove.

# rpm -qa --queryformat %{NAME}-%{VERSION}-%{ARCH}\\n

If you add %{RELEASE} you can also determine if the package is from other package vendors like RPMForge.

Since this was a x64 system, I wanted to remove the i386 version

# rpm -e libtool-libs-1.5.6-4.El4.2.i386

This had to be done with every duplicate package on the system.
Locate the i386 packages that interfered with the x64 packages can be done using the command

rpm -qa | sort | uniq -d

These packages have dependencies so you have to add these manually, really fun job to do.

Edit:
In RHEL5 you can use yum to remove packages in a easy way

yum remove <package>.i386
yum remove <package>.x86_64