YUM is a very cool software installation and management tool for Red Hat Linux based systems. It makes installing new packages or updating existing ones a breeze by taking care of installing all the dependancies. Let’s look at how to set it up on a Fedora Linux machine and then how to use it.
If you don’t have YUM installed on your Linux machine then get it from project’s home page http://yum.baseurl.org/. After downloading the latest release of YUM for your version of Fedora Linux install it.
# rpm -ivh yum-3.4.3-3.xxx.x.xxxx.noarch.rpm
Once installed correctly you should be able to access YUM from using the command yum. Lets configure YUM before we begin using it. The configuration basically consists of adding a number of RPM repositories so that YUM can fetch the RPM packages and dependent packages required. Open the /etc/yum.conf file in a text editor and add the following lines at the end of the file:
name=Fedora Core $releasever – $basearch – Base
Save the file and quit your text editor. Now install GPG signature key for this server with the following command:
# rpm –import https://github.com/repoforge/repo-files/blob/master/repo/RPM-GPG-KEY.dag.txt
You can add other repositories in a similar manner. Remember to install the GPG key for them if you do. Now update your YUM database so it contains the packages form the new repository:
# yum check-update
Now if you want to install a package all you have to do is run the command yum install followed by the package name. Say you want to install the package cowsay, run the following command:
# yum install cowsay
If this package is in any of the repositories you have listed in your yum.conf file, YUM will promptly install it along with any dependencies. If not, it will report that it’s not available.
If you want to update all the packages in your system run this command:
# yum update
If you want to upgrade a single package:
# yum update cowsay
To remove an installed package:
# yum remove cowsay
You can also get a list of all the packages installed on your computer using this command:
# yum list installed
To get a list of all the updates available for your system:
# yum list updates
YUM is a very powerful tool and it can make managing packages on a Linux system really simple. Ubuntu users may be familiar with apt-get, a similar automated package installation tool. If you have a large number of Linux machines in your network you can optionally setup a local YUM repository which can save you a lot of bandwidth.