16

Is it possible to use yum to install a RPM file in Red Hat Linux?

Since I don't have the Internet access from this Linux I can not do wget and follow the process.

So all that I have now is a rpm file. How do I install it?

2 Answers 2

22

Yes, it is possible to install a single - already downloaded file - via YUM

yum install RPM-FILENAME.rpm from the directory you have the package downloaded to.

1
  • 1
    This has the benefit that if the package requires extra dependencies, they will be found, downloaded, and installed; while a plain rpm will just complain that the dependencies are missing. You can set up local repos (e.g. from the installation DVD) if you don't have 'net access.
    – vonbrand
    Commented Mar 1, 2013 at 2:51
1

rpm -ivh file.rpm

is the command for you. The benefit of yum is that it will resolve dependencies for you and also install dependencies along with the concerned application. But you need to define the path of software resources in /etc/yum.repos.d in a .repo file

1
  • 7
    If you use that command, you will see the RPMDB altered outside of yum warning next time you run a yum command. This can be resolved using yum history sync, but is best avoided by not using rpm and using the yum install command, as in the answer above, instead.
    – Dmitri
    Commented Aug 13, 2018 at 20:54

You must log in to answer this question.