If you like the latest and greatest version of everything and you use an RPM based system you probably want to learn how to create RPMs. You don't have to, you can just download the latest source and compile and install it in /usr/local. This of course leaves your system in a state where your RPM database does not accurately reflect what is installed on your system. Again, this will work, but building RPMs isn't (usually at least) that difficult.
First create some directories in your home directory:
$ mkdir ~/rpm $ mkdir -p ~/rpm/SOURCES $ mkdir -p ~/rpm/SPECS $ mkdir -p ~/rpm/BUILD $ mkdir -p ~/rpm/SRPMS $ mkdir -p ~/rpm/RPMS
Next create an RPM macros file in your home directory:
$ echo "%_topdir $HOME/rpm" > $HOME/.rpmmacros
Now, get the source RPM for the program you want to upgrade. This is often the step that seems like a roadblock because if you can find the source RPM for your distro then you can usually get the compiled RPM and so there'd be no need to build it. So really this step is: create the source RPM for the program. The easy way to do this is to get the source RPM for the version that you have installed and modify it:
$ rpm -i abc-2.3.4-55.src.rpmThis should create a file ~/rpm/SPECS/abc.spec
$ cd ~/rpm/SPECS $ rpmbuild -ba abc.specIf you have all the required tools and dependencies installed, and if luck is with you this will create RPM files in ~/RPMS/i586 or ~/RPMS/x86_64 (or something appropriate for you architecture).
$ sudo rpm -U ~/RPMS/i586/abc-2.4.1-2001.i586.rpm
One of the things that may give you problems are patch files. RPMs can automatically apply patches during the build process, often when upgrading to a new version some of the patches are already included in the new source distribution and so the build tries to install them again. To fix this, edit the spec file and remove the application of the patch.
If you're trying to install a program that isn't included in your distro (or the version you're currently running) you can try using a spec file from another distro or a spec file from a newer version of your distro, but this often doesn't work without a lot of spec file modification. Distros have different builtin RPM macros and assume different locations for certain things and so the spec files often need tweaking. This can even be true between different versions of the same distro, things can get rearranged and break compatibility.
With this in hand you can keep your system and your RPM database in sync, and if you can't well at least you're still running Linux.
__________________________Mitch Frazier is the System Administrator at Linux Journal.