[Rpm-maint] Install rpm without being root

Vagner Pinto Morais Vagner.Morais_externo at sonae.com
Wed Nov 21 16:38:25 UTC 2007

Thanks for the answer... But, if i specify the dbpath to a directory that any unprivileged user can acess, do i still need to be a root user, to run rpm -i <rpm>?




-----Original Message-----
From: rpm-maint-bounces at lists.rpm.org [mailto:rpm-maint-bounces at lists.rpm.org] On Behalf Of Manfred Hollstein
Sent: quarta-feira, 21 de Novembro de 2007 16:15
To: rpm-maint at lists.rpm.org
Subject: Re: [Rpm-maint] Install rpm without being root

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.

Rpm-maint mailing list
Rpm-maint at lists.rpm.org

More information about the Rpm-maint mailing list