When compiling an application called pyrit on a new CentOS Linux server I ran into an issue with some libraries. Pyrit is an application used to perform dictionary attacks against WPA handshakes and can be really useful for security auditing. The error below is easily resolved on any version of Linux by simply installing the glibc-devel RPM package. Below I display the error in detail as well as how to resolve the error on CentOS by installing the glibc-devel RPM using the Yum package manager.
CentOS Library Error: stubs.h and stubs-32.h
- [root@dev pyrit]# python26 setup.py build
- running build
- running build_py
- running build_ext
- building 'cpyrit._cpyrit_cpu' extension
- gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fPIC -I/usr/include/python2.6 -c cpyrit/_cpyrit_cpu.c -o build/temp.linux-x86_64-2.6/cpyrit/_cpyrit_cpu.o -DVERSION="0.3.1-dev (svn r230)"
- In file included from /usr/include/features.h:352,
- from /usr/include/limits.h:27,
- from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h:122,
- from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h:7,
- from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h:11,
- from /usr/include/python2.6/Python.h:19,
- from cpyrit/_cpyrit_cpu.c:21:
- /usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory
- error: command 'gcc' failed with exit status 1
If you receive the above error it can more than likely be resolved by installing the glibc-devel RPM package. Below is an example of installing this package using yum on CentOS Linux.
Install glibc-devel Using Yum Package Manager:
- [root@dev ~]# yum install glibc-devel
- Loading "allowdowngrade" plugin
- Loading "fastestmirror" plugin
- Loading mirror speeds from cached hostfile
- * base: mirror.cisp.com
- * updates: ftp.osuosl.org
- * addons: centos.mirrors.tds.net
- Setting up Install Process
- Parsing package install arguments
- Resolving Dependencies
- --> Running transaction check
- ---> Package glibc-devel.i386 0:2.5-42.el5_4.3 set to be updated
- --> Finished Dependency Resolution
- Dependencies Resolved
- =============================================================================
- Package Arch Version Repository Size
- =============================================================================
- Installing:
- glibc-devel i386 2.5-42.el5_4.3 updates 2.0 M
- Transaction Summary
- =============================================================================
- Install 1 Package(s)
- Update 0 Package(s)
- Remove 0 Package(s)
- Total download size: 2.0 M
- Is this ok [y/N]: y
- Downloading Packages:
- (1/1): glibc-devel-2.5-42 100% |=========================| 2.0 MB 00:01
- Running rpm_check_debug
- Running Transaction Test
- Finished Transaction Test
- Transaction Test Succeeded
- Running Transaction
- Installing: glibc-devel ######################### [1/1]
- Installed: glibc-devel.i386 0:2.5-42.el5_4.3
- Complete!
After installing the glibc-devel package I was able to build pyrit without issue. This common is probably unlikely in most scenarios since it would be required when compiling most applications so chances are this package is already installed on most peoples servers.
This worked for me. A million thanks to saving me hours of shooting in the dark.
Hello Chris,
No problem. Thanks for taking the time to leave feedback.
Thanks.
alex
Thanks for the info. To add more ,If you are using 64bit machine and trying to create 32bit binary.Use yum install glibc-devel.i686 since yum install glibc-devel will install only 64 bit packages HTH
Hello lakshmipathi,
No problem. Thanks for the info on 32-bit packages on a 64-bit computer!
Thanks.
alex