Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Red Hat This forum is for the discussion of Red Hat Linux.


  Search this Thread
Old 09-19-2007, 01:49 PM   #1
Registered: Oct 2004
Location: USA
Distribution: Fedora Core 3, Red Hat 9, CentOS 4.2, Mandriva, Ret Hat Enterprise Linux 4.0
Posts: 116

Rep: Reputation: 15
installing an rpm as a non-root user

Hi all,

I've build an rpm package for my own software. I usually install this as root which gives no problems. However, i'm trying to run the processes as part of this package as a non-root user and install the rpm as non-root as well. When i try to install as a non-root user i get the error:

"cannot create transaction lock on /var/lock/rpm/transaction"

I believe regular users don't have read/write permissions on the rpm database. Where does this database reside? can the permissions be changed to allow a certain non-root user to install the rpm and run the processes packaged in the rpm. I don't want to do everything as root as that is a bad practice. What options do i have?

Thanks in advance!
Old 09-19-2007, 02:15 PM   #2
Senior Member
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (
Posts: 1,900

Rep: Reputation: 69
If you can install entirely arbitrary RPMs, that is equivalent to being root if we consider planned abuse by either someone who actually installs RPMs or someone who hosts RPMs. But yes, just being able to install RPMs gives you much less ways to ruin system easily. So, you need some mechanism of limited sharing of root privileges. Consider 'sudo'.
Old 09-19-2007, 03:54 PM   #3
Senior Member
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96

The DBs are in /var/lib/rpm , should you wish to try this out. You'll also have to use the relocate flag to install the RPM in a non-system location (since users don't have write permission to places like /usr/bin and /etc). Back up everything in /var/lib/rpm before you do anything, though, as I imagine you run a very high risk of borking your system doing this.

You could, I suppose, setuid the rpm binary so that rpm runs as root. Suicide from a security point of view, though.


Last edited by ilikejam; 09-19-2007 at 03:55 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
rpm -i --prefix=/home/user package.src.rpm doesn't work? registering Linux - Software 2 07-18-2007 12:28 PM
Installing rpm files onto nfs server root file systems WilNel Linux - Networking 0 05-17-2007 06:05 PM
What is the general rule(if any?) about downloading/installing as User or Root? kbusche Linux - Newbie 1 03-24-2006 03:00 AM
can i install rpm package as non-root user? parv Linux - Software 10 09-17-2004 11:46 PM
rpm freezes up while installing as root timberwolf Linux - Software 4 12-07-2003 06:18 PM > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 11:12 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration