1

I'm trying to run rpm -i to install an rpm but it fails. I must always use root to do the installation. why ?

[alankoh@sjoam2 Downloads]$ rpm -i sqldeveloper-4.0.3.16.84-1.noarch.rpm error: can't create transaction lock on /var/lib/rpm/.rpm.lock (Permission denied)

The rpm belong to the right user (alankoh:alankoh) with 664 permission.

1

It's normal. All the system files – both the rpm database and the directories into which your .rpm would install stuff – are only modifiable by root. Who owns the .rpm file is not important.

  • Technically, one could make an rpm which installed into a wide-open directory. But the rpm database requires privileged access to update it. – Thomas Dickey Jun 23 '15 at 22:00
  • @ThomasDickey [root@localhost bin]# ls -l rpm -rwxr-xr-x. 1 root root 30600 Nov 22 2013 rpm [root@localhost bin]# I see that the rpm is own by root, but it allows others to execute it as well. So where is the part whereby a user does not have permission to it ? – Noob Jun 24 '15 at 6:34
  • The comment was not about the rpm program, but its database (files usually under /var/lib/rpm), which is owned by root and requires privileged access to modify. – Thomas Dickey Jun 24 '15 at 7:53
  • @Thomas Dickey then how does a user install a program only for himself ? or how does a root install a program that can be usable only by a certain user ? – Noob Jul 9 '15 at 13:42
  • For oneself, usually that's put in ~/bin (home directory). The root user can install a program with specific user- and/or group-ownership to match a given user. – Thomas Dickey Jul 9 '15 at 14:02

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.