Skip to Content

Using YUM

CVirus's picture

***This Article is old and outdated, Dont use it with FC4***

Using Yum

No doubt that every single Yellow-Dog and Fedora user knows this awesome tool named YUM. In this article we will know what is YUM and how to use it and what are the advantages and disadvantages that exist in YUM. We will also talk a little bit about the yum.conf file. And finally we will get to know some useful links related to YUM. Here we go !. :)

What is YUM ?

YUM is an interactive, automated update program which can be used for maintaining systems using rpm . Meaning; You can use YUM to install new rpm packages or update exisiting packages. The word YUM stands for "Yellowdog Updater Modified".

The yum.conf File :

YUM uses a configuration file named yum.conf this Configuration File is found in /etc/yum.conf. This yum.conf contains the configuration data needed by YUM . Such as the Debug Level, Cache Directory and finally and the most important are the URL's of the Fedora and YUM repositories which are needed inorder to get the requested packages from them. You can build up a yum.conf file by yourself but first you will need to check the "yum.conf" Manual Page in order to know more details concerning this configuration file $ man yum.conf

How Can I use YUM ???

In this part we will get to know the basic commands and uses for YUM ... But first we have to configure our "yum.conf" file as stated in the above section and second you have to be using the root account as we will be dealing with rpm's installation and updates or you can switch from your account to the root account by using this command $ su root

Now , some of the basic and important commands that you should know inorder To be able To use YUM.

Installing a package
  1. yum install Package1 Package2 Package3 ...

    This command is used to install the latest version of a package or a group of packages while making sure that all the dependencies (The extra packages that the installed package needs inorder to work properly) are satisfied.

    Here is a screenshot of YUM while it is installing "Kplayer" using this command that we've discussed:

    Note

    Before you start getting packages from any repository using YUM ... You need To download the Header Files (YUM does this Automaticly). Every rpm has a header, that header contains a complete file list, package descriptions, lists of what features it provides, lists of what it requires, what it conflicts with ... In order for rpm to make a decision about what it will need to be installed, it needs the information in the header ... What Yum does is to copy the header from the repository, then the client part of yum uses those headers to determine what needs to be Installed/Upgraded/Erased.

    Updating Packages
    1. yum update Package1 Package2 Package3

      This command updates the listed packages which are given as arguments to YUM while ensuring that all dependencies are satisfied ... If this command is ran without an argument list (Packages List) ... It updates every single package installed on your system ... Aint this pretty good ? hehe ... :)

      Searching For Packages

      This command is used to find any packages matching the argument you gave in the Package Name, Description, Summary. This command is useful if you only know a peice of the package name or somethin' related to it.

      Uninstalling Packages
      1. yum remove Package1 Package2 Package3

        This command is used to remove the specified packages from your system as well as removing any packages which depend on the package being removed.

        Note These are the most important commands of YUM ... For more commands read the Manual page $ man yum

        What are the Advantages and Disadvantages of YUM ???

        Advantages

        Disadvantages

        hmmm ... Really didn't see any disadvantages ... Then the answer is NONE !

        Some Links Related To YUM

        Nuthin's Left ... CYA Later

        CVirus

Comments

whirlpool's picture

Very neat article

I really would like to thank you CVirus for this article. If this LUG came out with articles and reviews in this form we will be very beneficial to a scale we might never had thought about before.

CVirus's picture

thanks

Thank u whirpool for reading my article :) ... I just wanted to know what are my Prons and Cons ... So I can make future articles much more better ... thank u once again :)

YoussefAssad's picture

Yeah, great stuff

Well written, cvirus. Good work.

(although yum is clearly an apt ripoff :-p )

--

Login's picture

Very Great work

it is a very good work CVirus. thank u for ur great effort

mildewy's picture

nice

thnx Cvirus for that article......,it's so nice really and try to do more :-)

Very Nice

just wanted to congratulate you for the great work you have done. keep it up and lets see more great and well explained articles like these :)

¦«àlGhôôl.lôôhGl໦

Hi. My name is Mike and

Hi.

My name is Mike and I use Fedora Core 2 as my main OS at home and for work, I also use RH9 at work, along with FreeBSD. When updating or installing software on the RH9 and FreeBSD, I do it remotely, for the most part all the software I need is on the default install of the distro I'm using, but occasionally (especially for my home PC) I need to install some applications not included on the Distro CDs. For example mp3 support for FC2.

For you apt or apt-get users, yum is just as powerful as apt. I like it because its included with the RH and FC Distros and there is no need to download another application to do the same thing. I will say this the only thing that I have found out apt has and yum doesn't is a GUI. I will address that at the end.

Now the only option/switch I use every time I use yum is -y. -y will tell yum to say yes to all questions.

First off yum use a file (/etc/yum.conf) to keep track of repositories to search for applications. The default yum.conf has only 2 or 3 repositories for updating its distro. For Example FC2 has these default entries:

Code: name=Fedora Linux $releasever - $basearch - core baseurl=ayo.freshrpms.net/fedora/linux/$releasever/$basearch/core name=Fedora Linux $releasever - $basearch - updates baseurl=ayo.freshrpms.net/fedora/linux/$releasever/$basearch/updates name=Fedora Linux $releasever - $basearch - freshrpms baseurl=ayo.freshrpms.net/fedora/linux/$releasever/$basearch/freshrpms

  1. name=Fedora Linux $releasever - $basearch - testing updates
  2. baseurl=ayo.freshrpms.net/fedora/linux/$releasever/$basearch/tupdates

I add these entries to those: Code: name=Livna.org Fedora Compatible Packages (stable) baseurl=rpm.livna.org/fedora/$releasever/$basearch/yum/stable gpgcheck=1

name=Fedora US $releasever - $basearch - Latest Packages baseurl=download.fedora.us/fedora/fedora/2/i386/SRPMS.os/

name=Fedora Core 2 NewRPMS.sunsite.dk baseurl=newrpms.sunsite.dk/apt/redhat/en/i386/fc2

name=Dag RPM Repository for Fedora Core 2 baseurl=apt.sw.be/fedora/$releasever/en/$basearch/dag

name=Extra Fedora rpms dries - $releasever - $basearch baseurl=dries.studentenweb.org/yum/fedora/linux/$releasever/$basearch/dries Those extra repositories act as a backup to my default ones if those servers aren't available and also contain applications not available with the distro. Also they will have an entry for your distro (if applicable) to add to your yum.conf listed on their sites.

Once those are added to your yum.conf you can now update the headers for your distro by entering: Code: yum -y check-update That will only download headers for new updates or software available. If you haven't ran yum check-update yet it will take a bit depending on the amount of headers needed to download.

This command will not only update the headers but also download and install any updates available:

Code: yum -y update You can also specify a specific package to update by typing:

Code: after updating the one command (besides installing a package) i continuously us is: Code: yum -y list That will display a list of packages available for install. I usually redirect the output using the (>) redirection operator. Code: yum -y list > packageslist If I want to see whats installed on my system, this is the command I use. Code: yum -y list installed To install a new package I first use the list option to see whats available and then type: Code: Working example: yum -y install mplayer will download and install mplayer. Whats nice about yum and apt is that they will resolve dependencies. If you don't have a dependency and its available in your list of repositories yum will download it and install it for you automatically. If its not available then you will have to search for it and install it manually first then continue with yum. If you now a packages name and want to know if its available with out searching through the list? Code: This will search your repositories for a matching package. Code: yum -y info package name This will provide you with a full detail and summary on a package. To remove or uninstall a package: Code: yum -y remove ,package name> OK yum will download the packages but will not delete them after install/upgrade and will not delete old headers. Simply type Code: yum -y clean I hope this heps some of you when installing /updating your software. There are a few more options that yum provides (for the most part variations of ones stated here.) by typing: Code: man yum That will give you the man page on yum with more options. now IU haven't had a problem installing anything or updating except when a dependency hasn't been packaged yet. For example to update to php 4.3.6.5 I need to remove some php-* because they aren't available yet and require 4.3.4.5 Example php-mmcache needs 4.3.4.5 and not compatible with 4.3.6.5 So I'll wait. Now one last little thing if you want to install more than package using yum -y install. You CAN. This will download and install mplayer, boson, and cssed in one shot: Code: yum -y install mplayer boson cssed I have a small bash script for yum and rpm (RPM queries are used to supplement yums). yummenu contains all the commands I have included here and some more. It will download and install yum and RPM from sources if you can't have them available and has the yum.conf I use for FC2 and RH9 _

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.


Dr. Radut | book