centos6.5下升级gnutls

gnutls全称 GNU Transport Layer Security Library,即基于GNU版权协议的传输层安全协议,是wget支持https中的ssl协议的基础库。

开始 libgnutls 源码编译

在做一个开源项目时 需要 libgnutls >= 3.2.15 当前系统gnutls-2.12 所以选择源码编译升级

wget https://www.gnupg.org/ftp/gcrypt/gnutls/v3.5/gnutls-3.5.19.tar.xz
tar -xvJf gnutls-3.5.19.tar.xz
cd  gnutls-3.5.19
./configure

 提示找不到nettle-3.1  

 

源码编译 nettle 3.1

wget http://ftp.gnu.org/gnu/nettle/nettle-3.1.tar.gz
tar -zxvf nettle-3.1.tar.gz
cd nettle-3.1
./configure 
make
make install

在gnutls中./configure会报错 找不到nettle-3.1  其实是PKG_CONFIG_PATH路径没有找到这两个文件的原因

[root@localhost nettle-3.1]# find  ./  -name  "*.pc"
./hogweed.pc
./nettle.pc
[root@localhost nettle-3.1]#cp *.pc  /usr/lib64/pkgconfig/

再次在gnutls中./configure 报错gmp找不到 其实存在只是头文件不存在 yum install -y gmp-devel 

再次./configure 报错 Libtasn1 4.9 was not found. To use the included one, use --with-included-libtasn1

 

源码编译 Libtasn1 4.9

查看系统当前版本:

[test@localhost lib]$ rpm -qa | grep libtasn1
libtasn1-devel-2.3-6.el6_5.x86_64
libtasn1-2.3-6.el6_5.x86_64

版本太低  下载 Libtasn1 4.9版本 

wget http://ftp.gnu.org/gnu/libtasn1/libtasn1-4.9.tar.gz
tar -zxvf libtasn1-4.9.tar.gz
cd libtasn1-4.9
./configure 
make

解压编译出现错误  [-Wlogical-op] 是警告代码 可以在 https://blog.csdn.net/whatday/article/details/83780754 查询警告含义

ASN1.c:1192: error: logical '&&' with non-zero constant will always evaluate as true [-Wlogical-op]

注释掉 libtasn1-4.9/lib/ASN1.c 中的1192行   // && !yytable_value_is_error (yytable[yyx + yyn])) 

继续make出现 一下错误

../gl/timespec.h:41: error: no previous prototype for 'make_timespec' [-Wmissing-prototypes]
../gl/timespec.h:78: error: no previous prototype for 'timespec_cmp' [-Wmissing-prototypes]
../gl/timespec.h:88: error: no previous prototype for 'timespec_sign' [-Wmissing-prototypes]
../gl/timespec.h:102: error: no previous prototype for 'timespectod' [-Wmissing-prototypes]

在libtasn1-4.9/gl/timespec.h 增加函数声明

// 增加函数声明 去除编译警告
_GL_TIMESPEC_INLINE struct timespec make_timespec (time_t s, long int ns);
_GL_TIMESPEC_INLINE int timespec_cmp (struct timespec a, struct timespec b);
_GL_TIMESPEC_INLINE int timespec_sign (struct timespec a);
_GL_TIMESPEC_INLINE double timespectod (struct timespec a);

然后编译成功 继续在gnutls中./configure 报错找不到libtasn1-4.9 

[test@localhost libtasn1-4.9]$ find ./ -name "*.pc"
./lib/libtasn1.pc
[test@localhost libtasn1-4.9]$ sudo cp lib/libtasn1.pc /usr/lib64/pkgconfig/

 

继续 libgnutls 源码编译

继续在gnutls中./configure 报错如下

configure: error: 
  ***
  *** Libunistring was not found. To use the included one, use --with-included-unistring

sudo yum install -y libunistring libunistring-devel 解决

继续在gnutls中./configure 报错如下

configure: WARNING: *** LIBIDN2 was not found. You will not be able to use IDN2008 support
checking for LIBIDN... no
configure: WARNING:
***
*** libidn was not found. IDNA support will be disabled.
*** 
checking for nettle_secp_192r1 in -lhogweed... no
checking whether to build libdane... yes
checking for unbound library... no
configure: WARNING:
***
*** libunbound was not found. Libdane will not be built.
*** 
checking for P11_KIT... no
configure: error: 
***
*** p11-kit >= 0.23.1 was not found. To disable PKCS #11 support
*** use --without-p11-kit, otherwise you may get p11-kit from
*** http://p11-glue.freedesktop.org/p11-kit.html
*** 

根据错误提示 缺少 LIBIDN2  libunbound  p11-kit >= 0.23.1

源码编译LIBIDN2

wget https://ftp.gnu.org/gnu/libidn/libidn2-2.0.5.tar.gz
tar -zxvf libidn2-2.0.5.tar.gz
cd libidn2-2.0.5
./configure
make 
make install

yum安装libunbound

[test@localhost libidn2-2.0.5]$ yum list | grep unbound
unbound.x86_64                              1.4.20-23.el6_9.4           @base   
unbound-devel.x86_64                        1.4.20-23.el6_9.4           @base   
unbound-libs.x86_64                         1.4.20-23.el6_9.4           @base   
pcp-pmda-unbound.x86_64                     3.10.9-9.el6                base    
unbound-devel.i686                          1.4.20-23.el6_9.4           base    
unbound-libs.i686                           1.4.20-23.el6_9.4           base    
unbound-python.i686                         1.4.20-23.el6_9.4           base    
unbound-python.x86_64                       1.4.20-23.el6_9.4           base    
[test@localhost libidn2-2.0.5]$ sudo yum install -y unbound unbound-devel

源码编译p11-kit-0.23.14

wget https://github.com/p11-glue/p11-kit/releases/download/0.23.14/p11-kit-0.23.14.tar.gz
tar -zxvf p11-kit-0.23.14.tar.gz
cd p11-kit-0.23.14
./configure
make
make install
cp p11-kit/p11-kit-1.pc /usr/lib64/pkgconfig/

再次在gnutls中./configure通过 make make install 编译安装成功

覆盖原有的pc文件

cp ./lib/gnutls.pc /usr/lib64/pkgconfig/gnutls.pc

 

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
升级 CentOS6.5 到 CentOS7.0 是一个比较复杂的过程,需要仔细阅读并按照以下步骤进行操作: 1. 备份数据:在进行任何系统升级之前,务必备份所有重要数据,以防止意外数据丢失。 2. 更新 CentOS6.5:在升级之前,先确保 CentOS6.5 的所有软件包都是最新的。执行以下命令更新系统: ``` yum update ``` 3. 安装 CentOS 7.0 的升级工具:为了将 CentOS 6.5 升级到 CentOS 7.0,需要安装一个名为“redhat-upgrade-tool”的软件包。执行以下命令安装该软件包: ``` yum install redhat-upgrade-tool preupgrade-assistant-contents ``` 4. 运行系统升级工具:安装完升级工具后,使用以下命令启动升级过程: ``` preupg ``` 此命令将生成一个报告,其中列出了可以升级的软件包和问题,如果没有问题,则可以继续进行升级过程。 5. 更新 yum 配置文件:将 CentOS 6.5 的 yum 配置文件备份并替换为 CentOS 7.0 的 yum 配置文件。执行以下命令: ``` cp /etc/yum.conf /etc/yum.conf.bak cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo ``` 6. 运行系统升级命令:最后,运行以下命令将 CentOS 6.5 升级到 CentOS 7.0: ``` redhat-upgrade-tool-cli --network 7.0 --instrepo=http://mirrors.aliyun.com/centos/7/os/x86_64/ ``` 此命令将下载并安装所有必需的软件包,升级系统到 CentOS 7.0。 7. 重启系统:完成升级后,重启系统以使更改生效: ``` reboot ``` 请注意,此过程可能需要一些时间,并且在执行过程中可能会出现错误或问题。因此,请务必按照上述步骤进行操作,并确保已备份所有数据。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值