Re: Newbie's second RPM: Install fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Just so you know binary only RPMS are evil.  You should teach your 
developer that integrating his source an rpmbuild makes everyone's life 
easier.

Now to solve your problem :) :

Installing things as non-root is a little tricky.  First remember the 
default RPM database is writeable only by root.  So what to do then? Well, 
you'll have to create a seperate rpm database, in each user's home 
directory.  Once that is done, you can use the --root option and specify 
the homedir/rootfs(or whatever you want to call the root of your 
filesystem) and the rpm will install into the homedir with using the rpm 
database in the homedir.

The initializing of the rpmdb should look something like:

rpm --initdb --dbpath /home/username/rpmdb


and when you install packages into the user's home dir, it would look 
something like:


rpm --root /home/username/rootfs


Check out the rpm man page.  It wouldn't be a good pratice to give 
everyone system rpmdb access, or else your system is eventually gonna get 
fried.  Another option would be to use sudo and only give rpm access to a 
few people.

Good luck.

James

James S. Martin, RHCE
Contractor
Administrative Office of the United States Courts
Washington, DC
(202) 502-2394

rpm-list-bounces@xxxxxxxxxx wrote on 05/26/2004 06:05:51 PM:

> After finally getting my Hello World program properly wrapped
> up in an RPM package, I'm now advancing toward my real goal.
> The thing I want to do is apparently a bit out of the mainstream,
> so I have run into a roadblock concerning file permissions.
> 
> I am dealing with some software that is under someone else's
> control.  I have read access to a directory tree.  I want to
> wrap up that whole tree in a binary RPM.  I don't care about
> a source RPM.  I want to make the binary RPM installable by
> non-root users.
> 
> I was able to produce the binary RPM by stripping the prep,
> build, and install portions of the SPEC file to almost nothing.
> They just create a link to the directory tree so the RPM-making
> step can find it.  It works!  The binary RPM is created, and it
> seems to contain the right things.
> 
> Things go bad when I try to install the RPM.  It fails like this:
> $ rpm -ivh --dbpath ~/rpm/db --prefix ~/foo facilities-v2r9p0-0.i386.rpm
> Preparing...                ########################################### 
[100%]
>    1:facilities             error: unpacking of archive failed on file 
> /u/ek/pln/foo/facilities: cpio: chmod failed - Permission denied
> 
> Notes: 
> *  /u/ek/pln/foo and /u/ek/pln/foo/facilities belong to me, and they
>    are writable.
> *  ~/rmp/db was properly set up with rpm --initdb.
> *  -vv doesn't add any useful information.
> *  I added %defattr(-,<myUserID>,<myGroup>) to the SPEC file, and
>    rpm -qplv tells me that the files in the RPM belong to me.
>    The same thing happens with %defattr(-,root,root).
> 
> 
> *   Patrick L. Nolan                                          *
> *   W. W. Hansen Experimental Physics Laboratory (HEPL)       * 
> *   Stanford University                                       *
> 
> 
> _______________________________________________
> Rpm-list mailing list
> Rpm-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/rpm-list


_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux