Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 160627 - rpm --root not working with sudo
Summary: rpm --root not working with sudo
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 4
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Paul Nasrat
QA Contact: Mike McLean
: 160628 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2005-06-16 07:23 UTC by Steven Shiau
Modified: 2007-11-30 22:11 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2005-08-27 02:07:47 UTC

Attachments (Terms of Use)

Description Steven Shiau 2005-06-16 07:23:15 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; zh-TW; rv:1.7.8) Gecko/20050511 Firefox/1.0.4

Description of problem:
When I run 
sudo rpm -Uvh --root /tftpboot/node_root ...
It fails.
However, if I su as root, then run
rpm -Uvh --root /tftpboot/node_root
It works.

Version-Release number of selected component (if applicable):
rpm-4.4.1-21, sudo-1.6.8p8-1

How reproducible:

Steps to Reproduce:
1. as root
2. mkdir -p /tftpboot/node_root/var/lib/rpm/
3. rsync -a /var/lib/rpm/* /tftpboot/node_root/var/lib/rpm/
4. sudo rpm -Uvh -v -v -v -v -v --root /tftpboot/node_root/ --force --nodeps --noscripts


Actual Results:  The resulet is
error: skipping - transfer failed - Unknown or unexpected error

Expected Results:  Install the kernel-2.6.11-1.1369_FC4.i586.rpm in /tftpboot/node_root successfully with sudo.

Additional info:

By adding more "-v", i.e.
sudo rpm -Uvh -v -v -v -v -v --root /tftpboot/node_root/ --force --nodeps --noscripts

The results show
D:  ... as /tftpboot/node_root/home/steven/rpmbuild/tmp/rpm-xfer.5dIm3z
D: failed to create /tftpboot/node_root/home/steven/rpmbuild/tmp/rpm-xfer.5dIm3z: No such file or directory
error: skipping - transfer failed - Unknown or unexpected error
D: May free Score board((nil))
So I think rpm should can use another temp directory if it can not find the one it want.

Comment 1 Paul Nasrat 2005-06-20 12:34:49 UTC
*** Bug 160628 has been marked as a duplicate of this bug. ***

Comment 2 Jeff Johnson 2005-08-27 02:07:47 UTC
You appear to have %_tmppath configured to /home/steven/rpmbuild/tmp/.

rpm is doing exactly what you specified, using "another temp directory" is not the right solution.

Either configure some other path or insure that the directory exists within the chroot path.

Note You need to log in before you can comment on or make changes to this bug.