Comment goes here
You should log in and post some comments! The link is up there in the toolbar. Go nuts!
 

Installing New Software Programs - Red Hat

« Back to Basics Articles

Beginners Level Course: Installing New Software Programs

The way you install a new program will depend primarily on two things:
1) What distribution (version) of Linux are you using?
2) What is the origin of the program that you want to install?

RPM
If you're using Red Hat or a distribution that bases itself on Red Hat, then you're going to use the RPM method. OK racing fans- RPM doesn't have anything to do with revolutions per minute. It stands for Red Hat PackageManager. This system takes the heartache out of installing programs under Linux, for the most part. You can go to the Red Hat website or any number of mirrors and get programs for Linux. Developers will almost always offer their programs in RPM format due to its popularity. I also want to note that RPM has also come to mean the package itself (as in \"I downloaded an RPM yesterday\").


There are some basic commands you're going to need to know to take advantage of the RPM system.

rpm -i new_program.rpm

This installs the program (-i option for install)
rpm -q program_name

This \"queries\" your system to see if you've got a certain program installed. Let's say you hear there's a new version of the popular Internet browser Opera for Linux and you don't know if your Red Hat based distribution installs this by default or not. Before you download the RPM for Opera, you could type the command:
rpm -q opera
If you do have the package installed, it would give you the version number:

opera-11.62

If you don't have the package installed, you will see:
 package opera is not installed

If you don't have Opera installed, then you can download their RPM and run rpm -i opera_whatever_version.rpm as root and install the program.

If you do have the program installed and the rpm -q opera command gives you a older version number and you want the newerone, then you have two options.

One is to \"uninstall\" the older package and install a new one in its place. Not that this is the most efficient option. I just wanted to introduce you to the -e option for RPM. That is, to get rid of a program that you've installed, you would type rpm -e program_name. For example, if you've got Opera's beta version 7 and you've just downloaded the beta version 8, then you would first do:
rpm -e opera
This gets rid of Opera from your system. Then you would type rpm -i opera_beta8.rpm (or whatever the package is actually called). That installs the new version.
As I said, this is not the most efficient way to update packages. The usual way is to use the -U (as inUpdate command.
You would type:


rpm -U opera_new_version.rpm


and that would install the new version and remove the old version from your system.

Those are the basic commands of the RPM install/update system in a nutshell.

When you're using your windows manager, there are some very good tools for installing, updating and uninstalling RPMs that are graphically based. You can choose menu options to do all that we explained before instead of having to type the commands in the terminal. You may want to look into programs like Kpackage for KDE orGnome RPM for the GNOME enviroment. They may make these tasks a lot easier, especially if you're just starting out in the Linux world.



Some words of caution on downloading RPMs
Some of the most popular Linux distributions base their install and update prodedures on Red Hat's package management system. These include Mandrake and SuSE for example. Both of these companies create their own RPMs to be specifically installed on their systems. That means if you're using SuSE or Mandrake your best bet is to go to their respective \"official\" websites or mirrors and download their particular RPM and install it using the procedure outlined above or their specific tools. You may run into a problem if you installed an RPM for Red Hat on a SuSE system. Certain components in the package (like documentation or libraries) may get copied into a different directory than was intended for that system. Third party RPMs from reputable companies, like the Opera web browser in mentioned above, should install fine on any RPM based system. I have successfully installed this package (the same exact RPM file) on SuSE, Mandrake and Red Hat. I even converted this RPM to Debian (.deb) package format and successfully installed it in a computer running Debian. More on this conversion later in the show!

Just a brief second word of caution. Getting and RPM doesn't necessarily mean that you're automatically (or \"auto-magically\") going to be able to install it. Many websites out there offer RPMs for download. The good ones usually include a list on that particular RPM's page of other programs or libraries that you need in order successfully install and use the program. If you see a list a mile long of \"requirements\" (those other programs and libraries you need), then you might want to ask yourself if you really want to try that program out.


And here's just an editorial comment on my part about this type of thing as well. The big buzz word with Linux is \"free\". That's fine. You can theoretically get a distribution from the Internet along with programs and install it for free. (ie. no money down). I think, however, that time is money, to use the trite expression. Time might be even more valuable than money. (lost money might be re-earned but not lost time). When I first installed Linux oh so many years ago, updating and installing stuff was at times a frustrating experience. I suggest that newcomers to the Linux world buy (yes, I said buy) a good boxed set of a commercial distribution and then they'll have more programs than they would ever need, all installed and working properly along with a manual to tell you what to doin case something doesn't work.


yum

Yum is a package manager that was developed by Duke University to improve the installation of RPMs. Yum searches numerous repositories for packages and their dependencies so they may be installed together in an effort to alleviate dependency issues. Red Hat Enterprise Linux 5 uses Yum to fetch packages and install RPMs and well as many Red Hat derivatives like CentOS and Fedora Core.


Yum uses a configuration file at /etc/yum.conf.

There are multiple ways by which you can install a repository on the system and install/update packages :


yum search package_name


yum info package_name



yum install package_name



yum update package_name



yum remove package_name