A chronological documentation test project, nothing serious, really!

26 Feb 2008 List rpm package content

To list the contents of a package just run the command

# rpm -ql packagename


# rpm -ql nmap


Tags: , , ,

Posted by

07 Dec 2007 Rotate logs manually

Today I had to manually rotate a couple of logs since they had generated a filesize of over 1.8GB of pure text.

This was done by issuing the command

logrotate /etc/logrotate.d/file_to_be_rotated

In my case I had to rotate my firewall log /var/log/firewall described in a custom made file, /etc/logrotate.d/firewall

logrotate -v -f /etc/logrotate.d/firewall

-v Verbose logging
-f Force rotation of logs even if not needed

Tags: , ,

Posted by

30 Nov 2007 Upgrade from Fedora Core 7 to Core 8

This is the steps I took to upgrade a running Fedora Core 7 installation to Core 8 using yum from the command line. Please note that live upgrades are not recommended by the Fedora Project.

Make a list of the systems current packages for later reference:

rpm -qa --qf '%{NAME}\n' | sort | uniq > ~/new-pkgnames.txt

Make a backup of any system configuration data (as root):

tar czf ~/etc-`date +%F`.tar.gz /etc

yum clean all

Make sure the new repo files isn’t placed as .rpmnew files, perhaps by

mv /etc/yum.repos.d/fedora-updates.repo.rpmnew /etc/yum.repos.d/fedora-updates.repo
mv /etc/yum.repos.d/fedora.repo.rpmnew /etc/yum.repos.d/fedora.repo

Also make sure that all the 3rd party repos you normally use point to the repository for the new Fedora release.

Next the upgrade.
Make sure you are in runlevel 3

telinit 3

Run the following command to update the yum repo on your box:

rpm -Uhv rpm -Uvh rpm -Uvh

yum might complain about conflicts or requirements. That is probably because you have used non-standard repositories or installed non-standard packages manually. Try to guess which packages cause the problem (or at least is a part of the dependency chain) – uninstall them and try again. Remember to install the packages again if they are essential.

Tip: Find and review “lost” packages.
You can find orphaned packages (ie packages not in the repositories anymore) after the upgrade with the tool package-cleanup from the yum-utils package

yum install yum-utils; package-cleanup --orphans

It’s often helpful to run this command before the update, too. For packages with a failing “%postun” script the old package will remain partly installed. Remove it with

rpm -e package-name-and-version

If you forget to remove the avahi package it will refuse to be removed from the system with a error message “error: %postun(avahi-0.6.17-1.fc7.i386) scriptlet failed, exit status 1”. I haven’t looked up this error message any further.

I had to clean yum to make it aware of the recent package change, this might not be necessary.

yum clean all
yum upgrade

Ensure that all (new) essential packages from the new version is installed with

yum groupupdate Base

You might want to update other groups too, see

yum grouplist

The system had to upgrade 937 packages before fedora Core 7 is a fedora Core 8 installation.

After the upgrade has finished a reboot is required and it was time to check for orphaned packages

package-cleanup --orphans

The command for removing these packages is described earlier.

Source:, and

Tags: , , , , ,

Posted by

26 Nov 2007 Query RPM database/packages and list their architecture

If you use the –queryformat argument with rpm it is possible to query RPMs for different architectures installed# rpm -qa --queryformat %{NAME}-%{VERSION}-%{ARCH}\\n | grep dbus-glib | sortResultdbus-glib-0.22-12.EL.5-i386dbus-glib-0.22-12.EL.5-x86_64This can also be used in one of my previous posts: Remove duplicate packages when querying the rpm database.

Tags: , , ,

Posted by

17 Oct 2007 Enabling Remote Access to the Installation System

You may access either graphical or text interfaces for the Redhat installation system from any other system. Access to a text mode display requires telnet, which is installed by default on Fedora systems. To remotely access the graphical display of an installation system, use client software that supports the VNC (Virtual Network Computing) display protocol. A number of providers offer VNC clients for Microsoft Windows and Mac OS, as well as UNIX-based systems.

The installation system supports two methods of establishing a VNC connection. You may start the installation, and manually login to the graphical display with a VNC client on another system. Alternatively, you may configure the installation system to automatically connect to a VNC client on the network that is running in listening mode.

Enabling Remote Access with VNC
To enable remote graphical access to the installation system, enter two options at the prompt:

linux vnc vncpassword=astrongpassword

The vnc option enables the VNC service. The vncpassword option sets a password for remote access. The example shown above sets the password as astrongpassword. The VNC password must be at least six characters long.

Specify the language, keyboard layout and network settings for the installation system with the screens that follow. You may then access the graphical interface through a VNC client. The installation system displays the correct connection setting for the VNC client:

Starting VNC...
The VNC server is now running.
Please connect to to begin the install...
Starting graphical installation...
Press <enter> for a shell

You may then login to the installation system with a VNC client. Start the VNC client Enter the server and display number in the VNC Server dialog. For the example above, the VNC Server is

This is possible on RedHat, Fedora and probably other distributions derived on these distributions like CentOS.

Tags: , , , , ,

Posted by