How to Install Local Package Using YUM [2 Practical Cases]

LINUX
FUNDAMENTALS
A Complete Guide for Beginners Enroll Course Now

Red Hat-based systems, such as RHEL, Fedora, and CentOS, rely on YUM (Yellowdog Updater Modified) as their main package management tool. It is built upon the foundation of the rpm package manager, introducing advanced capabilities that transcend rpm’s basic functionality. It simplifies the intricacies of package installation, dependency resolution, version management, software removal, etc. This package manager enhances the Linux/Unix user experience. In this guide, I will dive into the process of using the yum package manager to install an app package using the “yum install” and “yum localinstall” commands in Red Hat-based distributions.

To install a local package using yum, check the following commands:

  1. Using localinstall: yum localinstall [package_name].rpm
  2. Using install: yum install [package_name].rpm

Process Flow Chart to install a local package using YUM:

step by step process to install package from local rpm file using yum install and yum localinstall command in Red Hat-based distributions using command line interface (CLI).

[Distro Used Throughout the Tutorial: RHEL 9.2]

2 Cases to Install a Local Package Using YUM

Package installation is the most important task in package management. Sometimes you do not find your desired package or a specific version of a package in the remote repositories. So you can not install them directly. But if you have access to the rpm file of the package you can install it locally.

The YUM package manager offers two straightforward methods for installing local packages: using the “yum install” command and using the “yum localinstall” command. These methods are perfect for any Red Hat-based Linux system. You can easily handle this task using the yum package manager in the Command Line Interface (CLI). In this article, I will guide you through the step-by-step process of installing a local app package using yum.

You can read our Comparative Analysis of Methods to distinguish between these two methods and pick the best one for your needs.

Case 1: Install Local Package Using “yum localinstall” Command

In the YUM package manager, the “localinstall” option exclusively installs packages from local files, providing more control over package management. To install an app package from a local file using the “yum localinstall” command simply follow this step-by-step process:

  1. To begin, open the Terminal on your system.

  2. Next, use the cd command to navigate to the directory where your local app package file is located shown in the following image:

    cd Downloads/
    EXPLANATION
    • cd: This command changes the current directory to the destination directory.
    • Downloads/: Name of the destination directory.

    change to the directory where rpm file is located

  3. After that, type the following command to view all the files and folders in that directory:

    ls
    EXPLANATION
    • ls: List all files and folders of the current directory in the command line.

    install an app package from local file using yum localinstall command

  4. Now, execute the following command to install an app package from the local .rpm file. It will look similar to the above image.

    sudo yum localinstall audacity-2.3.3-2.el8.x86_64.rpm
    EXPLANATION
    • sudo: Permits administrative permission.
    • yum: Package manager in Red Hat-based distributions.
    • localinstall: Install an app package from a local rpm file using yum.
    • audacity-2.3.3-2.el8.x86_64.rpm: Name of the local file.

    You will be asked for your sudo user password as shown in the next image after running this. Provide your sudo password.

    press Y to confirm installation

  5. After that, press “Y” to confirm the installation as shown in the above image.

  6. Then, the yum package manager will automatically install your app package from the local file like the image below:

    local app package installation complete

    Finally, after the local app package installation is complete, your system will display a confirmation message indicating the successful installation. With these steps and transitions, you have successfully installed a local package using the “yum localinstall” command.

Case 2: Install Local Package Using “yum install” Command

In the YUM package manager, the “install” option installs packages from online repositories or local files. To install an app package from a local file using the “yum install” command follow this process:

  1. To begin, open the Terminal on your system.

  2. Next, use the “cd” command to navigate to the directory where your local app package file is located:

    cd Downloads/

    change to the directory where rpm file is located

  3. After that, type the following command to view all the files and folders in that directory as shown in the previous image:

    ls

    install an app package from local file using yum install command

  4. Now, run the following command to install an app package from the local .rpm file. It will look similar to the above image.

    sudo yum install audacity-2.3.3-2.el8.x86_64.rpm
    EXPLANATION
    • install: Install an app package using yum.

    After running this, you will be prompted to enter your sudo user password, which is shown in the next image. Provide your sudo password.

  5. After that, you will need to confirm the installation. Type “Y” and press ENTER to proceed as shown in the following image:

    press Y to confirm installation

  6. Then, the yum package manager will automatically install your app package from the local file.

    local app package installation complete

    Finally, once the installation of the app package from the local file is complete, you will get a confirmation message of the successful installation in your system as shown in the above image.

Comparative Analysis of Methods

Check out the following comparison table between the discussed two cases of using the yum command to install an app package using a local <strong>.rpm</strong> file in Red Hat-based Linux distributions:

Cases Pros Cons
yum localinstall
  • Offline installation.
  • Precise control over installation.
  • Manual dependencies handling.
yum install
  • Very simple to use.
  • Automatic dependencies handling.
  • An active internet connection is required for dependency handling.

Among these two options of the yum command yum install offers simplicity and automatic dependency resolution for both local installation and online installation. Meanwhile yum localinstall excels in offline environments and precise version control.

Conclusion

In this comprehensive guide, I have walked you through the simple process of installing local packages using the YUM package manager. Whether you opt for yum install or yum localinstall you now have the knowledge to tailor your software environment to any Red Hat-based Linux system with ease.

People Also Ask

How to install yum command in Linux?

In Red Hat-based distributions yum is a very dependable package manager. If you want to install yum in Debian-based Linux distros run sudo apt install yum in the terminal. If you install yum in Arch Linux-based distro then run sudo pacman -S yum in the terminal.

What is RPM and yum in Linux?

RPM (Red Hat Package Manager) is a Linux command-line tool for installing, updating, and managing software packages. YUM (Yellowdog Updater Modified) is a higher-level package manager built on RPM, providing automatic dependency resolution and simplified package management in Red Hat-based Linux distributions.

Should I use yum or RPM?

In Red Hat-based distributions yum and rpm both are very dependable package managers. Yum is generally recommended because of its ease of use, automatic dependency resolution, and simplified package management. Rpm is generally used when you need precise control over your package management.

How to install RPM file locally?

The command for installing an RPM file locally varies with the package manager. The sudo rpm -i package_name is used in the rpm package manager, sudo yum localinstall package_name is used in the yum package manager, and in the dnf package manager sudo dnf install package_name is used to install an RPM app package locally.


Related Articles


<< Go Back to Package Installation in Linux | Package Management in Linux | Learn Linux Basics

4.9/5 - (17 votes)
Ridoy Chandra Shil

Hello everyone. I am Ridoy Chandra Shil, currently working as a Linux Content Developer Executive at SOFTEKO. I am a Biomedical Engineering graduate from Bangladesh University of Engineering and Technology. I am a science and tech enthusiast. In my free time, I read articles about new tech and watch documentaries on science-related topics. I am also a big fan of “The Big Bang Theory”. Read Full Bio

Leave a Comment