Technology and General Blog

Installing packages in any Linux-based mostly Working system is like a task that takes place on a day by day basis, and it is noticed that we normally need to have to put in some deals for a brief period. On the other hand, the deals expected for incredibly little time stay within our method and consume the disk area.

In a program wherever we have much less assets in conditions of disk area, the disk place stays nearly comprehensive, and we have to continue to keep test on undesirable applications and packages and get rid of them from time to time.

For these kinds of situations where by you have to set up and use some packages for a shorter time period, it is a better follow and advisable to put in the packages in some precise or short-term listing. The listing will keep different from all other offer clusters, and you can conveniently take away the packages.

Yum vs. DNF

Yum, an abbreviation of “Yellow Updater modified,” is a primary bundle manager for putting in packages in CentOS or any RHEL-based functioning system. While DNF, shortened for “Dandified Yum,” is the hottest and attribute-enriched package deal supervisor when compared to Yum.

In the most up-to-date variations of the RHEL-primarily based operating method, it is advisable to use DNF in its place of Yum. This post will supply a in depth guidebook on putting in a deal to a precise directory employing Yum and DNF package deal supervisor.

The syntax for setting up a offer:

Normally, we put in a deal employing the syntax presented down below:

$ sudo dnf <options> install <package-name>

The option we can use for putting in a package to a distinct directory is:

In the option mentioned earlier mentioned, we can deliver a certain listing route where we want to put in the package.

Let us attempt to put in a offer to exhibit how to put in a package to a particular directory.

Case in point:

For example, we want to install git in some distinct directory like /opt/temp-deals.

Let us very first develop a “temp-packages” listing inside the /decide directory in which we want to install Git.

$ sudo mkdir temp-offers

To set up git in the /choose/temp-packages directory, we will deliver the path to the –installroot selection in the yum set up command as demonstrated down below:

$ sudo dnf –installroot=/opt/temp-packages –releasever=/ install git

In the previously mentioned command, we also have to have to use the –releasever selection though creating installroot. Usually, we will have to deal with an mistake as shown in the screenshot hooked up under:

So, execute the set up command with the –releasever=/ possibility.

Variety ‘y’ for granting extra disk area use and start off the installation procedure of the bundle you want to put in.

In the earlier mentioned screenshot connected, you can witness the installation of Git in the /decide/temp-packages directory.

The moment you are performed with the set up of the package deal, head to the /choose/temp-offers directory and execute the ls command to check out the files and directories in the /opt/temp-packages directory:

$ cd /opt/temp-offers
$ ls

You can see that a fully individual ecosystem is established within the /opt/temp-deals listing.

To use any bundle put in in a particular listing, we can go to the /usr/bin directory and operate it since we all know that the packages are set up in the /usr/bin directory. So, navigate to the usr/bin listing, which is within the /opt/temp-deals, applying the command specified down below:

$ cd /opt/temp-deals/usr/bin

In the bin directory, execute the ls and grep command to confirm if the preferred deal is installed or not. The command for locating and verifying the offer set up will go like this:

To confirm and know the installed model of Git, you can kind the command offered down below in the bin directory:

Or you can also validate the set up of Git by executing the basic ./git command in the /decide/temp-offers/usr/bin directory:

You can witness that git is put in productively in the /decide/temp-deals listing and operating properly high-quality as we want it to get the job done.


This publish consists of a temporary and thorough clarification on how to set up a offer to a distinct directory making use of the Yum or DNF package manager by making use of the –installroot alternative. This put up also demonstrates the entire method of putting in a bundle to a certain directory and utilizing that bundle. As an instance, we mounted Git in the “/choose” listing using the –installroot option and uncovered how to commence applying it.

Leave a Reply

Your email address will not be published. Required fields are marked *