# error: cannot create %sourcedir /usr/src/redhat/SOURCES

**URL:** <https://forums.digi.com/t/error-cannot-create-sourcedir-usr-src-redhat-sources/7166>\
**Category:** Realport\
**Created:** [January 2, 2007, 3:24pm UTC](https://forums.digi.com/t/error-cannot-create-sourcedir-usr-src-redhat-sources/7166 "2007-01-02T15:24:43Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![hm2k](https://avatars.discourse-cdn.com/v4/letter/h/a6a055/32.png) [@hm2k](https://forums.digi.com/u/hm2k)\
**Post date:** [January 2, 2007, 3:24pm UTC](https://forums.digi.com/t/error-cannot-create-sourcedir-usr-src-redhat-sources/7166/1 "2007-01-02T15:24:43Z")

</div>

I am trying to install the driver software on CentOS 4.4 for a digi portserver but I am having problems.

Files:  
[http://ftp1.digi.com/support/driver/40002086\_M.src.rpm](http://ftp1.digi.com/support/driver/40002086_M.src.rpm)  
[http://ftp1.digi.com/support/driver/40002086\_M.tgz](http://ftp1.digi.com/support/driver/40002086_M.tgz)  
[http://ftp1.digi.com/support/driver/93000359\_M.txt](http://ftp1.digi.com/support/driver/93000359_M.txt)

* * *

## [root@localhost ~]# rpm -ivv 40002086\_M.src.rpm D: ============== 40002086\_M.src.rpm D: Expected size: 3077003 = lead(96)+sigs(180)+pad(4)+data(3076723) D: Actual size: 3077003 D: 40002086\_M.src.rpm: MD5 digest: OK (6f4539a9c499f3b87d87fe1ab8509d20) D: added source package [0] D: found 1 source and 0 binary packages D: Expected size: 3077003 = lead(96)+sigs(180)+pad(4)+data(3076723) D: Actual size: 3077003 error: cannot create %sourcedir /usr/src/redhat/SOURCES

That didn’t work so I do:  
tar -zxvf 40002086\_M.tgz && cd dgrp-1.9 && ./configure

* * *

[root@localhost dgrp-1.9]# ./configure  
checking for awk… /bin/awk  
checking for arch… /bin/arch  
checking for cat… /bin/cat  
checking for cd… /bin/cd  
checking for chkconfig… /sbin/chkconfig  
checking for chmod… /bin/chmod  
checking for chown… /bin/chown  
checking for cp… /bin/cp  
checking for depmod… /sbin/depmod  
checking for echo… /bin/echo  
checking for fuser… /sbin/fuser  
checking for grep… /bin/grep  
checking for init… /sbin/init  
checking for insmod… /sbin/insmod  
checking for kill… /bin/kill  
checking for ln… /bin/ln  
checking for ls… /bin/ls  
checking for lsmod… /sbin/lsmod  
checking for make… /usr/bin/make  
checking for mkdir… /bin/mkdir  
checking for mknod… /bin/mknod  
checking for more… /bin/more  
checking for mv… /bin/mv  
checking for ps… /bin/ps  
checking for rm… /bin/rm  
checking for rmdir… /bin/rmdir  
checking for rmmod… /usr/local/bin/rmmod  
checking for sed… /bin/sed  
checking for sleep… /bin/sleep  
checking for stty… /bin/stty  
checking for tar… /bin/tar  
checking for tr… /usr/bin/tr  
checking for touch… /bin/touch  
checking for true… /bin/true  
checking for uname… /bin/uname  
checking for platform type… i386  
checking for gcc… gcc  
checking for gcc version… \>= 3.2 (3.4.6)  
checking for gcc… gcc  
checking for C compiler default output… a.out  
checking whether the C compiler works… yes  
checking whether we are cross compiling… no  
checking for suffix of executables…  
checking for suffix of object files… o  
checking whether we are using the GNU C compiler… yes  
checking whether gcc accepts -g… yes  
checking for gcc option to accept ANSI C… none needed  
checking for current kernel version… 2.6.9-42.ELsmp -\> 2.6.9-42. -\> 2.6.9  
checking for kernel headers… “Not found.”

* * *

- Unable to locate matching kernel source for the
- linux 2.6.9-42.ELsmp kernel that is currently running!
- 
- The Digi RealPort driver requires this linux kernel source to be
- installed as /usr/src/linux-2.6.9-42.ELsmp before being able to correctly
- build the driver.
- 
- Please install the kernel sources which must match the running
- linux 2.6.9-42.ELsmp kernel, and then try installing again.

* * *

## configure: error: Unable to find kernel headers. Failing configure script.

Anyone got any fantastic ideas of how to install this on CentOS?

---

<div class="post-metadata">

**Author:** ![herrold](https://avatars.discourse-cdn.com/v4/letter/h/ce73a5/32.png) [@herrold](https://forums.digi.com/u/herrold)\
**Post date:** [January 2, 2007, 3:43pm UTC](https://forums.digi.com/t/error-cannot-create-sourcedir-usr-src-redhat-sources/7166/2 "2007-01-02T15:43:37Z")

</div>

The issue is that an end user is building as root, and the permissions of the build system are not able to make a directory it wants on centos which uses a different hierarchy of directorys for builds

The topic is covered as to setting up a build environment for an end user at:

[http://www.oldrpm.org/hintskinks/buildtree/](http://www.oldrpm.org/hintskinks/buildtree/)

and a longer tutorial on rpm building is at:

[http://www.gurulabs.com/goodies/guru+guides.php](http://www.gurulabs.com/goodies/guru+guides.php)

Following that under centos-4, I get:

[herrold@centos-4 build]$ mkdir build  
[herrold@centos-4 build]$ cd build  
[herrold@centos-4 build]$ wget [http://ftp1.digi.com/support/driver/40002086\_M.src.rpm](http://ftp1.digi.com/support/driver/40002086_M.src.rpm)

… snip

10:32:03 (301.39 KB/s) - `40002086\_M.src.rpm’ saved [3077003/3077003]

[herrold@centos-4 build]$ rpmbuild --rebuild 40002086\_M.src.rpm  
Installing 40002086\_M.src.rpm  
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.37748

- umask 022

… snip

Requires(rpmlib): rpmlib(CompressedFileNames) \<= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) \<= 4.0-1  
Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/dgrp-buildroot  
Wrote: /home/herrold/rpmbuild/RPMS/i386/dgrp-1.9-6.i386.rpm  
Wrote: /home/herrold/rpmbuild/RPMS/i386/dgrp-debuginfo-1.9-6.i386.rpm  
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.62800

- umask 022

… snip

- exit 0  
[herrold@centos-4 build]$

---

<div class="post-metadata">

**Author:** ![userid0](https://avatars.discourse-cdn.com/v4/letter/u/f6c823/32.png) [@userid0](https://forums.digi.com/u/userid0)\
**Post date:** [January 2, 2007, 4:08pm UTC](https://forums.digi.com/t/error-cannot-create-sourcedir-usr-src-redhat-sources/7166/3 "2007-01-02T16:08:18Z")

</div>

[b][i][i]checking for current kernel version… 2.6.9-42.ELsmp -\> 2.6.9-42. -\> 2.6.9  
checking for kernel headers… “Not found.”

* * *

- Unable to locate matching kernel source for the
- linux 2.6.9-42.ELsmp kernel that is currently running!
- 
- The Digi RealPort driver requires this linux kernel source to be
- installed as /usr/src/linux-2.6.9-42.ELsmp before being able to correctly
- build the driver.
- 
- Please install the kernel sources which must match the running
- linux 2.6.9-42.ELsmp kernel, and then try installing again.

* * *

configure: error: Unable to find kernel headers. Failing configure script.[/i][/i][/b]

The above errors indicate that the kernel sources/headers are not found for your 2.6.9-42-ELsmp kernel. Have you installed the kernel-smp-devel package to match your kernel?

---

<div class="post-metadata">

**Author:** ![hm2k](https://avatars.discourse-cdn.com/v4/letter/h/a6a055/32.png) [@hm2k](https://forums.digi.com/u/hm2k)\
**Post date:** [January 2, 2007, 4:39pm UTC](https://forums.digi.com/t/error-cannot-create-sourcedir-usr-src-redhat-sources/7166/4 "2007-01-02T16:39:51Z")

</div>

This is the problem i’m faced with now.

“configure: error: Unable to find kernel headers. Failing configure script.”

On CentOS it appears that “/usr/src/linux-2.6.9-42.ELsmp” would not exist, however “/usr/src/kernels/2.6.9-42.0.3.EL-smp-i686” does.

Now I have installed kernel-smp-devel (I had only installed kernel-devel previously).

I’m assuming I need to do:  
ln -s /usr/src/kernels/2.6.9-42.0.3.EL-smp-i686 /usr/src/linux-2.6.9-42.ELsmp

And that should work.

Next issue is as follows…

checking OpenSSL header version… “Not found.”

* * *

- Unable to locate the OpenSSL headers!
- 
- The Digi RealPort driver requires the OpenSSL layer.
- 
- This driver will use the shipped version of the OpenSSL package that comes
- with this driver package.
- 
- There will be a considerable amount of extra time spent
- compiling this driver package (anywhere from 5 - 60 minutes),
- because the OpenSSL library will also be compiled.

* * *

So I did yum install openssl-devel, i’m guessing this will work…

Message was edited by: hm2k

---

<div class="post-metadata">

**Author:** ![userid0](https://avatars.discourse-cdn.com/v4/letter/u/f6c823/32.png) [@userid0](https://forums.digi.com/u/userid0)\
**Post date:** [January 2, 2007, 4:44pm UTC](https://forums.digi.com/t/error-cannot-create-sourcedir-usr-src-redhat-sources/7166/5 "2007-01-02T16:44:00Z")

</div>

The SSL files will be installed automatically with the Digi driver. It will just take a little extra time to compile, so there is no need to worry about that message.

---

<div class="post-metadata">

**Author:** ![hm2k](https://avatars.discourse-cdn.com/v4/letter/h/a6a055/32.png) [@hm2k](https://forums.digi.com/u/hm2k)\
**Post date:** [January 2, 2007, 4:54pm UTC](https://forums.digi.com/t/error-cannot-create-sourcedir-usr-src-redhat-sources/7166/6 "2007-01-02T16:54:36Z")

</div>

./configure worked…

Now time for make all…

[root@localhost dgrp-1.9]# make all  
(cd driver; make all)  
make[1]: Entering directory `/root/dgrp-1.9/driver' make -C /usr/src/linux-2.6.9-42.ELsmp SUBDIRS=$PWD modules MYPWD=/root/dgrp-1.9/driver MYMANDIR=/usr/share/man make[2]: Entering directory `/usr/src/kernels/2.6.9-42.0.3.EL-smp-i686’  
Building modules, stage 2.  
MODPOST  
make[2]: Leaving directory `/usr/src/kernels/2.6.9-42.0.3.EL-smp-i686' make[1]: Leaving directory `/root/dgrp-1.9/driver’  
(cd ditty; make all)  
make[1]: Entering directory `/root/dgrp-1.9/ditty' make[1]: Nothing to be done for `all’.  
make[1]: Leaving directory `/root/dgrp-1.9/ditty' (cd daemon; make all) make[1]: Entering directory `/root/dgrp-1.9/daemon’  
make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/root/dgrp-1.9/daemon’  
(cd config; make all)  
make[1]: Entering directory `/root/dgrp-1.9/config' echo "#!/bin/sh" &gt; dgrp_gui echo "# Run wish from the user's PATH \\" &gt;&gt; dgrp_gui echo "exec wish -f \"\$0\" \${1+\"\$@\"}" &gt;&gt; dgrp_gui cat dgrp_msgs.tcl dgrp_misc.tcl dgrp_nodes.tcl dgrp_ttys.tcl dgrp_scriptlog.tcl dgrp_main.tcl &gt;&gt; dgrp_gui chmod +x dgrp_gui make[1]: Leaving directory `/root/dgrp-1.9/config’  
(cd dgipserv; make -f Makefile.linux all)  
make[1]: Entering directory `/root/dgrp-1.9/dgipserv' make[1]: Nothing to be done for `all’.  
make[1]: Leaving directory `/root/dgrp-1.9/dgipserv' (cd dgelreset; make -f Makefile.linux all) make[1]: Entering directory `/root/dgrp-1.9/dgelreset’  
make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/root/dgrp-1.9/dgelreset’  
(cd dinc; make LINUX)  
make[1]: Entering directory `/root/dgrp-1.9/dinc' make[2]: Entering directory `/root/dgrp-1.9/dinc’  
make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/root/dgrp-1.9/dinc’  
make[1]: Leaving directory `/root/dgrp-1.9/dinc' (cd dparp; make linux) make[1]: Entering directory `/root/dgrp-1.9/dparp’  
make -f os/Makefile.Linux all  
make[2]: Entering directory `/root/dgrp-1.9/dparp' make -f os/Makefile.Linux all make[2]: Entering directory `/root/dgrp-1.9/dparp’  
gcc -O2 -g -W -Wall -DLINUX -I./inc -c -o main.o main.c  
main.c:24:21: curses.h: No such file or directory  
main.c:29:20: panel.h: No such file or directory  
In file included from main.c:44:  
./inc/dpa\_rp.h:119: error: syntax error before ‘_’ token  
./inc/dpa\_rp.h:119: warning: type defaults to `int' in declaration of `dfp’  
./inc/dpa\_rp.h:119: warning: data definition has no type or storage class  
In file included from main.c:47:  
./inc/curses\_helpers.h:49: error: syntax error before “WINDOW”  
./inc/curses\_helpers.h:49: warning: no semicolon at end of struct or union  
./inc/curses\_helpers.h:50: warning: type defaults to `int' in declaration of `pan’  
./inc/curses\_helpers.h:50: warning: data definition has no type or storage class  
./inc/curses\_helpers.h:56: error: syntax error before ‘}’ token  
./inc/curses\_helpers.h:56: warning: type defaults to `int' in declaration of `DigiWin’  
./inc/curses\_helpers.h:56: warning: data definition has no type or storage class  
./inc/curses\_helpers.h:71: error: syntax error before '_’ token  
./inc/curses\_helpers.h:71: warning: type defaults to `int' in declaration of `new\_digi\_win’  
./inc/curses\_helpers.h:71: warning: data definition has no type or storage class  
./inc/curses\_helpers.h:72: error: syntax error before ‘_’ token  
./inc/curses\_helpers.h:73: error: syntax error before '_’ token  
./inc/curses\_helpers.h:77: error: syntax error before ‘_’ token  
./inc/curses\_helpers.h:78: error: syntax error before '_’ token  
./inc/curses\_helpers.h:80: error: syntax error before ‘_’ token  
./inc/curses\_helpers.h:81: error: syntax error before '_’ token  
In file included from main.c:48:  
./inc/general\_panels.h:26: error: syntax error before ‘_’ token  
./inc/general\_panels.h:26: warning: type defaults to `int' in declaration of `MainWin’  
./inc/general\_panels.h:26: warning: data definition has no type or storage class  
./inc/general\_panels.h:27: error: syntax error before '_’ token  
./inc/general\_panels.h:27: warning: type defaults to `int' in declaration of `CRWin’  
./inc/general\_panels.h:27: warning: data definition has no type or storage class  
./inc/general\_panels.h:28: error: syntax error before ‘_’ token  
./inc/general\_panels.h:28: warning: type defaults to `int' in declaration of `HeadWin’  
./inc/general\_panels.h:28: warning: data definition has no type or storage class  
./inc/general\_panels.h:29: error: syntax error before '_’ token  
./inc/general\_panels.h:29: warning: type defaults to `int' in declaration of `IdentWin’  
./inc/general\_panels.h:29: warning: data definition has no type or storage class  
./inc/general\_panels.h:30: error: syntax error before ‘_’ token  
./inc/general\_panels.h:30: warning: type defaults to `int' in declaration of `ChanWin’  
./inc/general\_panels.h:30: warning: data definition has no type or storage class  
./inc/general\_panels.h:31: error: syntax error before '_’ token  
./inc/general\_panels.h:31: warning: type defaults to `int' in declaration of `LBWin’  
./inc/general\_panels.h:31: warning: data definition has no type or storage class  
./inc/general\_panels.h:32: error: syntax error before ‘_’ token  
./inc/general\_panels.h:32: warning: type defaults to `int' in declaration of `ScopeWin’  
./inc/general\_panels.h:32: warning: data definition has no type or storage class  
./inc/general\_panels.h:33: error: syntax error before '_’ token  
./inc/general\_panels.h:33: warning: type defaults to `int' in declaration of `ExamWin’  
./inc/general\_panels.h:33: warning: data definition has no type or storage class  
./inc/general\_panels.h:34: error: syntax error before ‘_’ token  
./inc/general\_panels.h:34: warning: type defaults to `int' in declaration of `NodeWin’  
./inc/general\_panels.h:34: warning: data definition has no type or storage class  
./inc/general\_panels.h:61: error: syntax error before '_’ token  
main.c:56: error: syntax error before ‘\*’ token  
main.c:56: warning: type defaults to `int' in declaration of `dfp’  
main.c:56: warning: data definition has no type or storage class  
main.c: In function `usage': main.c:77: warning: implicit declaration of function `printf’  
main.c:79: warning: implicit declaration of function `fprintf' main.c: In function `main’:  
main.c:98: error: `TRUE' undeclared (first use in this function) main.c:98: error: (Each undeclared identifier is reported only once main.c:98: error: for each function it appears in.) main.c:106: error: `stderr’ undeclared (first use in this function)  
main.c:123: error: `FALSE' undeclared (first use in this function) main.c:126: warning: implicit declaration of function `fopen’  
main.c:126: warning: assignment makes pointer from integer without a cast  
make[2]: \*\*\* [main.o] Error 1  
make[2]: Leaving directory `/root/dgrp-1.9/dparp' make[1]: *** [linux] Error 2 make[1]: Leaving directory `/root/dgrp-1.9/dparp’  
make: \*\*\* [build] Error 2  
[root@localhost dgrp-1.9]#

It failed… why? any ideas?

---

<div class="post-metadata">

**Author:** ![userid0](https://avatars.discourse-cdn.com/v4/letter/u/f6c823/32.png) [@userid0](https://forums.digi.com/u/userid0)\
**Post date:** [January 2, 2007, 6:04pm UTC](https://forums.digi.com/t/error-cannot-create-sourcedir-usr-src-redhat-sources/7166/7 "2007-01-02T18:04:40Z")

</div>

Looks like there is a mis-match with the kernel sources. You will want to confirm the running kernel matches the new installed sources exactly:

# uname -a

# rpm -qa | grep kernel

---

<div class="post-metadata">

**Author:** ![hm2k](https://avatars.discourse-cdn.com/v4/letter/h/a6a055/32.png) [@hm2k](https://forums.digi.com/u/hm2k)\
**Post date:** [January 2, 2007, 7:42pm UTC](https://forums.digi.com/t/error-cannot-create-sourcedir-usr-src-redhat-sources/7166/8 "2007-01-02T19:42:00Z")

</div>

[root@localhost dgrp-1.9]# uname -a  
Linux localhost.localdomain 2.6.9-42.ELsmp #1 SMP Sat Aug 12 09:39:11 CDT 2006 i686 i686 i386 GNU/Linux  
[root@localhost dgrp-1.9]# rpm -qa | grep kernel  
kernel-utils-2.4-13.1.83  
kernel-devel-2.6.9-42.0.3.EL  
kernel-smp-2.6.9-42.EL  
kernel-smp-2.6.9-42.0.3.EL  
kernel-2.6.9-42.EL  
kernel-2.6.9-42.0.3.EL  
kernel-smp-devel-2.6.9-42.0.3.EL

Also worth noting…

[root@localhost dgrp-1.9]# ls /usr/src/kernels  
2.6.9-42.0.3.EL-i686 2.6.9-42.0.3.EL-smp-i686

Also remember I created a symlink, as follows:  
ln -s /usr/src/kernels/2.6.9-42.0.3.EL-smp-i686 /usr/src/linux-2.6.9-42.ELsmp

Thanks.

---

<div class="post-metadata">

**Author:** ![userid0](https://avatars.discourse-cdn.com/v4/letter/u/f6c823/32.png) [@userid0](https://forums.digi.com/u/userid0)\
**Post date:** [January 2, 2007, 7:59pm UTC](https://forums.digi.com/t/error-cannot-create-sourcedir-usr-src-redhat-sources/7166/9 "2007-01-02T19:59:24Z")

</div>

Your running kernel is 2.6.9-42.ELsmp, while your kernel source is version 2.6.9-42.0.3.ELsmp.

I recommend booting into kernel version 2.6.9-42.0.3.ELsmp (which appears to be installed) and re-try the driver build or install the kernel-smp-devel-2.6.9-42 kernel source package (without the .0.3) to match your running kernel.

---

<div class="post-metadata">

**Author:** ![hm2k](https://avatars.discourse-cdn.com/v4/letter/h/a6a055/32.png) [@hm2k](https://forums.digi.com/u/hm2k)\
**Post date:** [January 2, 2007, 8:30pm UTC](https://forums.digi.com/t/error-cannot-create-sourcedir-usr-src-redhat-sources/7166/10 "2007-01-02T20:30:15Z")

</div>

I recently upgraded the kernel via yum update, I have not rebooted since the upgrade was done.

I’m assuming if I reboot it will automatically launch the new kernel, and it should compile without any issues?

---

<div class="post-metadata">

**Author:** ![userid0](https://avatars.discourse-cdn.com/v4/letter/u/f6c823/32.png) [@userid0](https://forums.digi.com/u/userid0)\
**Post date:** [January 2, 2007, 8:58pm UTC](https://forums.digi.com/t/error-cannot-create-sourcedir-usr-src-redhat-sources/7166/11 "2007-01-02T20:58:58Z")

</div>

Once booted into the new kernel, the driver package should install fine.

If not, I recommend contacting Digi Technical Support to pursue this matter further.

---

<div class="post-metadata">

**Author:** ![hm2k](https://avatars.discourse-cdn.com/v4/letter/h/a6a055/32.png) [@hm2k](https://forums.digi.com/u/hm2k)\
**Post date:** [January 2, 2007, 9:08pm UTC](https://forums.digi.com/t/error-cannot-create-sourcedir-usr-src-redhat-sources/7166/12 "2007-01-02T21:08:43Z")

</div>

Rebooted…

[root@localhost dgrp-1.9]# uname -a  
Linux localhost.localdomain 2.6.9-42.0.3.ELsmp #1 SMP Fri Oct 6 06:21:39 CDT 2006 i686 i686 i386 GNU/Linux

I tried a make all, failed, ./configure, make all, failed, make clean, ./configure, make all, failed.

It appears to be the same errors.

Looks like i’ve got to try and contact Digi Tech Support.

---

<div class="post-metadata">

**Author:** ![hm2k](https://avatars.discourse-cdn.com/v4/letter/h/a6a055/32.png) [@hm2k](https://forums.digi.com/u/hm2k)\
**Post date:** [January 3, 2007, 11:05am UTC](https://forums.digi.com/t/error-cannot-create-sourcedir-usr-src-redhat-sources/7166/13 "2007-01-03T11:05:25Z")

</div>

VERY interesting…

I just found this post…

[http://www.digi.com/support/forum/viewthread\_thread,3963#12399](http://www.digi.com/support/forum/viewthread_thread,3963#12399)

Which says…

You will need to install ncurses-devel. Additional package dependencies are listed here:

[http://search2.digi.com/support/kbaseresultdetl.jsp?id=377](http://search2.digi.com/support/kbaseresultdetl.jsp?id=377)

So I did:  
yum install ncurses-devel

and then did a make all… no errors!

make install and make postinstall had no errors either.

Thanks for everyone’s help, I hope this is useful to someone else in the future!
