open of .rpm failed: Permission denied

8,892

If your the rpm file is in your home directory and your home directory is on NFS, root may not have access to it. This is somehow unusual: normally, root can access every file. But in common setup, when root access a directory that is mounted over NFS, the rights of the user nobody are used instead of the root user. The main purpose is to ensure that root on the client cannot manipulate files as root on the server. This is implemented as “root has the permissions of nobody” rather than “root can have anybody's permissions execpt root's” primarily because this is easier (though there can be other reasons: some NFS server apply this to users other than root, so as to protect all system users on the server).

If this is the issue, you need to make both the rpm file and the directory containing the file accessible to root. That means making them accessible to the user nobody, and usually the only way to do that is to make the file and the directory world-readable. More precisely, the minimal permissions are

chmod a+x .
chmod a+r something.rpm

Alternatively, move the rpm file to a local directory.

mv something.rpm /tmp
sudo rpm -i /tmp/something.rpm
Share:
8,892
Oak
Author by

Oak

Working with LLVM? Check out my Eclipse plugin for LLVM IR.

Updated on September 18, 2022

Comments

  • Oak
    Oak over 1 year

    Whenever I try to install some .rpm I've downloaded, I'm getting:

    > sudo rpm -i something.rpm
    error: open of something.rpm failed: Permission denied
    

    It seems that the choice of rpm doesn't matter. I've chmodded the the .rpm first (777) but it doesn't make a difference. What am I missing? Using rpm -i -v doesn't reveal any additional information.

    System is RHEL6 64-bit.

    • Not Now
      Not Now over 11 years
      Can you show the output of sudo -l
    • derobert
      derobert over 11 years
      SELinux, maybe?
  • Oak
    Oak over 11 years
    Absolutely spot-on, thank you for the quick answer.