FUNDAMENTALS A Complete Guide for Beginners
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:
- Using localinstall:
yum localinstall [package_name].rpm
- Using install:
yum install [package_name].rpm
Process Flow Chart to install a local package using YUM:
[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.
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:
-
To begin, open the Terminal on your system.
-
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.
-
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.
-
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.
-
After that, press “Y” to confirm the installation as shown in the above image.
-
Then, the yum package manager will automatically install your app package from the local file like the image below:
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:
-
To begin, open the Terminal on your system.
-
Next, use the “cd” command to navigate to the directory where your local app package file is located:
cd Downloads/
-
After that, type the following command to view all the files and folders in that directory as shown in the previous image:
ls
-
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.
-
After that, you will need to confirm the installation. Type “Y” and press ENTER to proceed as shown in the following image:
-
Then, the yum package manager will automatically install your app package from the local file.
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 |
|
|
yum install |
|
|
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
- How to Install Specific Version of a Package Using YUM
- How to List Installed Packages Using RPM [2 Practical Cases]
- 3 Ways to Install Pacman Package Manager in Ubuntu
- How to Install Local Package Using RPM [A Quick Guide]
- How to Install RPM Packages Using DNF [4 Useful Cases]
- How to Install Local Package Using DNF [2 Practical Cases]
- 2 Ways to Install Group Packages Using DNF [With Cases]
- 5 Ways to List Installed Packages in RHEL Using DNF With Cases
- How to Install RPM Packages From Text File [5 Simple Cases]
<< Go Back to Package Installation in Linux | Package Management in Linux | Learn Linux Basics