LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (http://www.linuxquestions.org/questions/red-hat-31/)
-   -   rpm error: cannot create %sourcedir (http://www.linuxquestions.org/questions/red-hat-31/rpm-error-cannot-create-sourcedir-165733/)

ticro 04-03-2004 10:47 AM

rpm error: cannot create %sourcedir
 
very newbie here

using redhat 9

I am trying to install samba 3.0.2a-1. This is the first rpm install I've tried. When using the install command # rpm -ivh [filename] I get the following error message:

error: cannot create %sourcedir/usr/src/redhat/sources

Do I have to make a directory to put it in? What directory do I put it in?If so how do I specify rpm to put it there?

Thanks

Ticro

RobertP 04-03-2004 01:42 PM

That meesage either means you need to be root to create a directory, or a directory is missing, or the directory is write protected. It could also mean the directory is undefined because of an error in the rpm file.

mrcheeks 04-03-2004 02:49 PM

*are you root?
*is the file a .RPM or a .SRC.RPM which is different?

sawoy 04-26-2004 12:37 AM

i also find the answer on this question.
platform: Red Hat Advansed Server 3.0

i'm root.
i want to install mc-4.5.55-5.src.rpm

when i run:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
[root@rhas root]# rpm -ivvh /sawoy/mc-4.5.55-5.src.rpm
D: ============== /sawoy/mc-4.5.55-5.src.rpm
D: Expected size: 5973578 = lead(96)+sigs(433)+pad(7)+data(5973042)
D: Actual size: 5973578
D: opening db environment /var/lib/rpm/Packages create:cdb:mpool
D: opening db index /var/lib/rpm/Packages rdonly mode=0x0
D: locked db index /var/lib/rpm/Packages
D: opening db index /var/lib/rpm/Pubkeys rdonly mode=0x0
warning: /sawoy/mc-4.5.55-5.src.rpm: V3 DSA signature: NOKEY, key ID db42a60e
D: added source package [0]
D: found 1 source and 0 binary packages
D: Expected size: 5973578 = lead(96)+sigs(433)+pad(7)+data(5973042)
D: Actual size: 5973578
error: cannot create %sourcedir /usr/src/redhat/SOURCES
D: closed db index /var/lib/rpm/Pubkeys
D: closed db index /var/lib/rpm/Packages
D: closed db environment /var/lib/rpm/Packages
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

how i can install this package?

sawoy 04-26-2004 01:40 AM

i fiound answer.

rshendershot 02-09-2008 08:15 AM

Quote:

Originally Posted by sawoy (Post 899248)
i fiound answer.

I have the same problem AMD x86_64 fedora 8. What was your solution?

billymayday 02-09-2008 03:50 PM

One way at least is to build the rpm

Suppose the .src.rpm is in /usr/src

rpmbuild --rebuild package.src.rpm

You should then find the binary rpm in the /usr/src/redhat somewhere, and install as usual

joelgriffiths 01-16-2012 01:15 PM

I'm just adding this because it was never properly answered and the thread indexes high on google:

# yum install rpm-build

You are probably missing the rpm-build package. That package creates the missing directory.

herohat 03-28-2013 07:24 PM

Quote:

Originally Posted by joelgriffiths (Post 4576086)
I'm just adding this because it was never properly answered and the thread indexes high on google:

# yum install rpm-build

You are probably missing the rpm-build package. That package creates the missing directory.



Code:

root@server [~]# yum install rpm-build
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * addons: mirror.steadfast.net
 * base: mirror.sanctuaryhost.com
 * epel: mirror.steadfast.net
 * extras: mirror.team-cymru.org
 * update: mirror.sanctuaryhost.com
addons                                                                      | 1.9 kB    00:00   
base                                                                        | 1.1 kB    00:00   
epel                                                                        | 3.6 kB    00:00   
extras                                                                      | 2.1 kB    00:00   
update                                                                      | 1.9 kB    00:00   
Excluding Packages in global exclude list
Finished
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package rpm-build.i386 0:4.4.2.3-32.el5_9 set to be updated
--> Processing Dependency: rpm = 4.4.2.3-32.el5_9 for package: rpm-build
--> Running transaction check
---> Package rpm.i386 0:4.4.2.3-32.el5_9 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                Arch              Version                        Repository          Size
====================================================================================================
Installing:
 rpm-build              i386              4.4.2.3-32.el5_9                update              304 k
Installing for dependencies:
 rpm                    i386              4.4.2.3-32.el5_9                update              1.2 M

Transaction Summary
====================================================================================================
Install      2 Package(s)
Upgrade      0 Package(s)

Total size: 1.5 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing    : rpm                                                                          1/2
Error unpacking rpm package rpm-4.4.2.3-32.el5_9.i386
error: unpacking of archive failed on file /etc/rpm: cpio: mkdir
  Installing    : rpm-build                                                                    2/2
Error unpacking rpm package rpm-build-4.4.2.3-32.el5_9.i386
error: unpacking of archive failed on file /usr/src/redhat: cpio: mkdir

Failed:
  rpm.i386 0:4.4.2.3-32.el5_9                  rpm-build.i386 0:4.4.2.3-32.el5_9                 

Complete!
root@server [~]#

root@server [~]# ls -la /usr/src/
total 16
drwxr-xr-x  5 root root 4096 Mar 28 15:50 ./
drwxr-xr-x 16 root root 4096 Mar 28 19:39 ../
drwxr-xr-x  2 root root 4096 May 11  2011 debug/
drwxr-xr-x  4 root root 4096 Mar 28 18:44 kernels/
?---------  ? ?    ?      ?            ? redhat
root@server [~]#

Any ideas?... this is a CentOS release 5.9 (Final)

John VV 03-28-2013 08:43 PM

you are aware that this thread is from 2004 and for the now very dead RH9
RH9 did not have "yum"
that was not added until many years latter in RHEL5

herohat 03-30-2013 04:21 PM

Quote:

Originally Posted by John VV (Post 4920844)
you are aware that this thread is from 2004 and for the now very dead RH9
RH9 did not have "yum"
that was not added until many years latter in RHEL5


This thread was answer in 2012 and I am talking about Centos 5.9 with "yum".

digity 04-01-2013 02:52 AM

Ya, any word on this? I'm getting the same error on CentOS 5.9 too. I'm trying to install (or build?) a package that is only available as a *.src.rpm file.

herohat 04-01-2013 08:17 AM

Quote:

Originally Posted by digity (Post 4922527)
Ya, any word on this? I'm getting the same error on CentOS 5.9 too. I'm trying to install (or build?) a package that is only available as a *.src.rpm file.

This is an unsual case, I can't do basically anything, I can't delete, rename or change any attribute the folder: /usr/src/redhat

John VV 04-01-2013 08:27 AM

this is a red hat 9 thread
you are not using rh9

please start a new thread with CentOS 6.4 or centOS 5.9 in the title

the solution for this on RH9 is to install a modern operating system

if you are getting this
Quote:

error: cannot create %sourcedir/usr/src/redhat/sources
then make the folder
"/usr/src/redhat/sources"


All times are GMT -5. The time now is 01:56 AM.