在编译apr的时候,报错gcc没有安装,于是yum安装gcc,同样报错。

[root@plinuxos src]# yum install -y gcc
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.btte.net
 * epel: ftp.cuhk.edu.hk
 * extras: mirrors.btte.net
 * updates: mirrors.btte.net
Resolving Dependencies
--> Running transaction check
---> Package gcc.x86_64 0:4.8.5-11.el7 will be installed
--> Processing Dependency: cpp = 4.8.5-11.el7 for package: gcc-4.8.5-11.el7.x86_64
--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.8.5-11.el7.x86_64
--> Processing Dependency: libmpfr.so.4()(64bit) for package: gcc-4.8.5-11.el7.x86_64
--> Processing Dependency: libmpc.so.3()(64bit) for package: gcc-4.8.5-11.el7.x86_64
--> Running transaction check
---> Package cpp.x86_64 0:4.8.5-11.el7 will be installed
---> Package glibc-devel.x86_64 0:2.17-157.el7_3.5 will be installed
--> Processing Dependency: glibc-headers = 2.17-157.el7_3.5 for package: glibc-devel-2.17-157.el7_3.5.x86_64
--> Processing Dependency: glibc = 2.17-157.el7_3.5 for package: glibc-devel-2.17-157.el7_3.5.x86_64
--> Processing Dependency: glibc-headers for package: glibc-devel-2.17-157.el7_3.5.x86_64
---> Package libmpc.x86_64 0:1.0.1-3.el7 will be installed
---> Package mpfr.x86_64 0:3.1.1-4.el7 will be installed
--> Running transaction check
---> Package glibc.x86_64 0:2.17-157.el7_3.4 will be updated
--> Processing Dependency: glibc = 2.17-157.el7_3.4 for package: glibc-common-2.17-157.el7_3.4.x86_64
---> Package glibc.x86_64 0:2.17-157.el7_3.5 will be an update
---> Package glibc-headers.x86_64 0:2.17-157.el7_3.5 will be installed
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.17-157.el7_3.5.x86_64
--> Processing Dependency: kernel-headers for package: glibc-headers-2.17-157.el7_3.5.x86_64
--> Running transaction check
---> Package glibc-common.x86_64 0:2.17-157.el7_3.4 will be updated
---> Package glibc-common.x86_64 0:2.17-157.el7_3.5 will be an update
---> Package glibc-headers.x86_64 0:2.17-157.el7_3.5 will be installed
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.17-157.el7_3.5.x86_64
--> Processing Dependency: kernel-headers for package: glibc-headers-2.17-157.el7_3.5.x86_64
--> Finished Dependency Resolution
Error: Package: glibc-headers-2.17-157.el7_3.5.x86_64 (updates)
           Requires: kernel-headers >= 2.2.1
Error: Package: glibc-headers-2.17-157.el7_3.5.x86_64 (updates)
           Requires: kernel-headers
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

安装kernel-headers即可解决问题

wget http://vault.centos.org/5.7/os/x86_64/CentOS/kernel-headers-2.6.18-274.el5.x86_64.rpm
rpm -ivh kernel-headers-2.6.18-274.el5.x86_64.rpm