[Rpm-maint] Install rpm without being root

Manfred Hollstein mh at novell.com
Wed Nov 21 16:15:25 UTC 2007

On Wed, 21 Nov 2007, 16:53:10 +0100, Vagner Pinto Morais wrote:
> As far as i understand, I just need to be root, because the installation
> of a rpm package need to manipulate the db files, that usually are under
> /var/opt .

This is not the only reason, just look e.g. at the permission of the
file /bin/login which is not writeable for any unprivileged user.

>            If so, Is there any way to install the db in a directory for
> users with no-root permissions?

If you're interested to use "rpm" as a packaging system apart from the
system's structure (and packages), the following options in your ~/.rpmmacros
file will do the trick:

  %_dbpath /home/user/lib/rpm
  %_topdir /home/user/packages
  %_rpmdir /home/user/packages/RPMS
  %_tmppath /var/tmp

'%_dbpath' instructs the rpm program where to store the db files,
'%_topdir' and '%_rpmdir' are mostly interesting when using "rpmbuild"
to build your own RPM packages, as they describe where the usual BUILD,
SOURCES, RPMS, SRPMS directories are located.

FWIW, you can also pass "-dbpath /home/user/lib/rpm" to an invocation of
the rpm program to use the database in /home/user/lib/rpm rather than
the default path /var/lib/rpm, but sticking it into ~/.rpmmacros saves
some unnecessary typing... ;-)

> Thanks for your attention
> Regards
> Vagner

HTH, cheers.


More information about the Rpm-maint mailing list