I am trying to locally install an rpm package without using the internet. I tried the following:

sudo rpm -u kernel-devel-4.2.7-200.fc22.x86_64.rpm

and I got:

error: kernel-devel-4.2.7-200.fc22.x86_64.rpm: hdr blob(2060952): BAD, read returned 0
error: kernel-devel-4.2.7-200.fc22.x86_64.rpm cannot be installed

I also tried:

sudo dnf --disablerepo='*' install kernel-devel-4.2.7-200.fc22.x86_64.rpm

and it still seems to be using the internet, so I can't figure out if it works or not since the internet connection is really slow.

Is there a way to fix this?

  • sudo dnf install /path/to/package.rpm – ILMostro_7 Dec 13 '15 at 23:28
  • @ILMostro_7 Thanks, but it's still using the internet. – kolonel Dec 13 '15 at 23:36
  • 1
    @ILMostro_7 actually sorry, it works now. Thanks. – kolonel Dec 13 '15 at 23:50

sudo dnf install /path/to/package.rpm will act on the package in the given path.

  • When trying this on a LIVE cd, I have to add --disablerepo=* – Andy Mar 28 '18 at 16:36
  • @Andy, I'm not sure if that's something that has changed with recent versions of dnf, but I don't see why you wouldn't be able to install the package locally by explicitly providing the full path to the rpm file as suggested in the answer. – ILMostro_7 Mar 30 '18 at 4:14
  • I found out that in the end, you are right. What was happening for me, is that I was trying to install 10 RPMs, but I was accidentally missing one dependency. I had never run a dnf command online, so my yum cache was empty. Without --disablerepo, all I got was an error message failing to update the "Updates" repo. So I had no idea what the error was, but with the --disablerepo, I got a nice clear message that I was missing an package. – Andy Apr 3 '18 at 2:36
  • @Andy please accept the answer if it's correct. – ILMostro_7 May 24 '18 at 2:52

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.