I am not from System admin background, however due to some reasons I need to perform some tasks as described below:

I need to install some packages in RHEL in 4-5 nodes, using "yum" in RHEL 7.x OS. To do so, I came across various terms like: yum , .repo, .rpm.

I somewhat understood that using yum we can install a software, but I am having difficult in how yum gets the software from internet.

Can anyone help me understand the following points:

1) Is yum the program which does the software installation?

2) What is .rpm? Does .rpm have the actual software which gets installed? Is .rpm somewhat similar to .tar?

3) How does yum get / download the software from internet? Does it consult the .repo file?

4) When we write yum - y install some_program, does it first download the binaries from internet and then install or do we need to do some rsync.

I am confused, I did try finding the answers online, however my doubts still remain there. Can anyone help me in simple words?

  • RPM is package. Package of some software. It contains the files in CPIO archive (similar to tar, just different format) and some informations (e.g. which other packages it needs) and scripts which needs to be run when package is installed/upgraded/removed (those are automatically run by /usr/bin/rpm).

  • Most Linux software is dynamically linked. I.e. for firefox package you need libnss package (and bunch of others). This has the benefit that if there is bug/security issue, maintainer of this library update just that library and does not need to recompile all programs which use that (can be hundrends of them).

  • typical distribution (RHEL) is made of thousands of RPM packages. They are grouped in one directory called repository. Red Hat provides some base repository. Then there are some other repositories with some products (e.g all packages needed for OpenStack or Satellite or something else). One of the most known repository is EPEL https://fedoraproject.org/wiki/EPEL which contains package for RHELs. It provide software, which is missing in RHEL and it is supported by community (i.e. no warranty).

  • While you can download the RPM package by hand and install it using /usr/bin/rpm -Uvh somepackage.rpm you will very likely get some error that somelibrary is needed. If you download that package and try to install it, you will get error that someotherlibrary is needed. This is called dependency chain. Sometimes this depenency is even circular and you cannot install it one by one. When you install some software it is quite usual that it require tens or even hundreds of dependencies. Installing them by hand would take sooo much time.

  • YUM is program which will automatically resolve the dependencies and choose from repositories best packages to satisfy those dependencies. So even upgrade and installation of some software is easy task. E.g. yum install firefox.

  • Yum can download the packages for you. It just need to know the URL of those repositories (remember you can have one or more repositories configured for your system). The URL is stored in .repo files. They reside in /etc/yum.repos.d/. It is plain text file (in INI format) and contains the URL and some other informations (e.g. if packages are GPG signed). If you correctly set up repo files, then YUM can easily install the software from those repositories. When you execute /usr/bin/yum install firefox it will download information from all configured repositores, then it will inform you that firefox and X other dependencies will be installed. When you confirm it will download those package and then install them. No need to run rsync.

| improve this answer | |
  • Thanks so much for your detailed info, it is pretty clear now. thanks a ton! – CuriousMind Mar 21 '17 at 11:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.