linux安装源码包未解决

源码包安装
约定:源码包放在 cd/use/local/src

我先把httpd源码包下载到cd/use/local/src 如下所示
下载源码包

#cd/usr/local/src/
[root@localhost src]# wget http://mirrors.cnnic.cn/apache/apr/apr-util-1.6.1.tar.gz 下载源包

[root@localhost src]# wget http://mirrors.cnnic.cn/aparche/httpd-2.2.32.tar.gz
-bash: wget: 未找到命令 说明没有安装wget 命令,执行#yum intall -y wget
2018-01-10 13:54:04 错误 404:Not Found。出现这种情况说明下载链接是错误的,需要更新链接
#echo $? 结果是0 表示上一步正确,1表示上一步错误
下载完之后查看文件的类型
[root@localhost src]# ls
apr-util-1.6.1.tar.gz 说明是一个tar .gz的压缩包

解压压缩包
[root@localhost src]# tar -zxvf apr-util-1.6.1.tar.gz 解压源码包
apr-util-1.6.1/
apr-util-1.6.1/strmatch/
apr-util-1.6.1/strmatch/apr_strmatch.c
apr-util-1.6.1/uri/
apr-util-1.6.1/uri/apr_uri.c
apr-util-1.6.1/apr-util.spec
apr-util-1.6.1/README.FREETDS
....
....
配置相关选项——指定安装路径
[root@localhost apr-util-1.6.1]# ./configure --prefix=/usr/local/apache2 指定安装路径
出现如下错误
checking for gcc... no 说明没有安装gcc
checking for cc... no
checking for cl.exe... no

安装gcc
#yum install -y gcc
重新执行配置选项
[root@localhost apr-util-1.6.1]# ./configure --prefix=/usr/local/apache2
安装gcc之后还出现如下报错
[root@localhost apr-util-1.6.1]# ./configure --prefix=/usr/local/apache2
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking for working mkdir -p... yes
APR-util Version: 1.6.1
checking for chosen layout... apr-util
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
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 ISO C89... none needed
Applying apr-util hints file rules for x86_64-pc-linux-gnu
checking for APR... no
configure: error: APR could not be located. Please use the --with-apr option.
提示:configure: error: APR could not be located. Please use the --with-apr option. 说明需要指定--with-apr参数
指定参数编译
#./configure --with-apr=/usr/local/apr

编译完后结果还报错结果如下:

[root@localhost apr-util-1.6.1]# ./configure --with-apr=/usr/local/apr
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking for working mkdir -p... yes
APR-util Version: 1.6.1
checking for chosen layout... apr-util
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
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 ISO C89... none needed
Applying apr-util hints file rules for x86_64-pc-linux-gnu
checking for APR... configure: error: the --with-apr parameter is incorrect. It must specify an install prefix, a build directory, or an apr-config file.
[root@localhost apr-util-1.6.1]# echo $?
1
错误提示checking for APR... configure: error: the --with-apr parameter is incorrect. It must specify an install prefix, a build directory, or an apr-config file. 说明:配置错误:with-apr参数不正确,它必须指定一个安装前缀,一个构建目录或是一个配置apr文件。


本文转自 yzllinux博客,原文链接:    http://blog.51cto.com/12947851/2059262    如需转载请自行联系原作者


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
当你在Linux系统上尝试安装GDAL(Geospatial Data Abstraction Library)时,遇到`no such file or directory : gdal-config`这个错误,通常意味着系统找不到名为`gdal-config`的工具,这在GDAL构建过程中是必要的,因为它帮助查找库文件和配置信息。 这个错误可能有以下几个原因: 1. **GDAL包未正确安装**:确认你是否按照官方文档或适合你发行版的包管理器(如apt、yum、zypper等)安装了GDAL。如果没有,你需要先安装GDAL。 2. **GDAL配置文件路径错误**:`gdal-config`可能位于系统路径之外,比如某些自定义安装路径下。检查`PATH`环境变量,确保它包含了GDAL的bin目录。 3. **GDAL源码安装**:如果你从源代码编译安装GDAL,那么`gdal-config`会在编译后的安装目录(通常是`/usr/local`或`~/local`)的bin子目录中。确保编译时指定了正确的安装位置。 4. **第三方软件包问题**:有时候,依赖的开发工具包可能未正确安装或版本不匹配,比如Python的开发头文件。检查是否有相关的依赖项缺失。 为了解决这个问题,你可以尝试以下步骤: 1. **更新或重新安装GDAL**:使用包管理器更新GDAL到最新版本,或者卸载后重新安装。 2. **检查路径设置**:运行`which gdal-config`看它在哪里,如果没找到,可能需要添加GDAL的bin目录到`PATH`环境变量。 3. **检查编译选项**:如果是从源码编译,确认你正确设置了编译选项,包括安装目录。 4. **确认依赖安装**:确保所有依赖的库和工具,如Python header files,已经正确安装

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值