centos7编译安装ntp-4.2.8p14,编译安装过程中的问题解决(步骤详细)

centos版本:CentOS Linux release 7.4.1708 (Core)

ntp版本:ntp-4.2.8p14

 

一 设置dns服务器IP

在/etc/resolv.conf里添加下面行

nameserver 114.114.114.114

centos7编译安装ntp-4.2.8p14,编译安装过程中的问题解决(步骤详细)

二  yum install wget -y

下载源码:

wget https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-4.2.8p14.tar.gz

centos7编译安装ntp-4.2.8p14,编译安装过程中的问题解决(步骤详细)

安装编译工具:

yum install gcc gcc-c++ openssl-devel libstdc++* libcap* m4 autoconf libtool

解压源码包

tar -zxvf ntp-4.2.8p14.tar.gz

cd ntp-4.2.8p14

./configure --prefix=/usr --bindir=/usr/sbin --enable-all-clocks --enable-parse-clocks --docdir=/usr/share/doc/ntp-4.2.8p14

make && make install

正常情况,上面可以顺利安装

但是有时候也会出现下面的报错

centos7编译安装ntp-4.2.8p14,编译安装过程中的问题解决(步骤详细)

这时候,yum install aclocal发现压根没有这个包

我们在源码目录下,执行./bootstrap试试

出现下面错误提示

centos7编译安装ntp-4.2.8p14,编译安装过程中的问题解决(步骤详细)

需要我们安装更高版本automake,我们下载就安装automake1.5

卸载原有的automake

yum remove automke

mkdir -p /root/dev_env

cd /root/dev_env

wget http://mirror.hust.edu.cn/gnu/automake/automake-1.15.tar.gz

cd automake-1.15.tar.gz

./configure

make && make install

安装automake后,重新回到ntp-4.2.8p14

cd /root/ntp-4.2.8p14

./bootstrap

./configure  --prefix=/usr  --bindir=/usr/sbin --enable-all-clocks --enable-parse-clocks --docdir=/usr/share/doc/ntp-4.2.8p14

make && make install

验证编译安装成功

centos7编译安装ntp-4.2.8p14,编译安装过程中的问题解决(步骤详细)

注意:上述编译出现报错后,可以先执行./bootstrap看看