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.

Force a user to change password upon first login

This is how you can force a Redhat user to change his password upon first login on a Redhat 5 installation. This might work on other versions and distributions…

  1. First lock the account to prevent the user from logging in until the change has been made
  2. # usermod -L <username>
  3. Change the password expiration date to 0 to ensure the user changes the password during the next login attempt
  4. # chage -d 0 <username>
  5. To unlock the account after the change do the following:
  6. # usermod -U <username>

Redhat documentation in one place

http://www.redhat.com/docs/manuals/enterprise/ is a documentation page I always return to when I manage Redhat Enterprise Linux systems.

Redhat has put a lot of effort in their documentation and even allow you to download them as PDF documents.

The documentation below is for RHEL5.2

Deployment Guide May 21, 2008 PDF
Installation Guide May 21, 2008 PDF
Virtualization Guide May 21, 2008 PDF
Cluster Suite Overview May 21, 2008 PDF
Cluster Administration May 21, 2008 PDF
LVM Administrator’s Guide May 21, 2008 PDF
Global File System May 21, 2008 PDF
Using GNBD with GFS May 21, 2008 PDF
Linux Virtual Server Administration May 21, 2008 PDF
Using Device-Mapper Multipath May 21, 2008 PDF
Tuning and Optimizing Red Hat Enterprise Linux for Oracle 9i and 10g Databases Nov 2007 PDF
Online Storage Reconfiguration Guide (Beta) July 2, 2008 PDF

These documents is a great resource if you plan to become a RHCT or RHCE.

Disable IPv6 on Redhat RHEL5

This post describes how to disable IPv6 on a Redhat (RHEL5) installation. I haven’t had the time to test it on other version of Redhat.

Edit /etc/sysconfig/network and change

NETWORKING_IPV6=no

Edit /etc/modprobe.conf and add these lines

alias net-pf-10 off
alias ipv6 off

Stop the ipv6tables service

# service ip6tables stop

Disable the ipv6tables service

# chkconfig ip6tables off

IPv6 will be disabled after the next reboot.

Edit
This also works on RHEL6/CentOS6