centos7中安装最新版本的make

发布时间 2023-07-16 11:05:12作者: 小鲨鱼2018

 

001、官网下载: https://ftp.gnu.org/gnu/make/

 

002、查看当前的make版本及系统版本

a、make版本

[root@PC1 ~]# make --version
GNU Make 3.82
Built for x86_64-redhat-linux-gnu
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

 

b、系统版本

[root@PC1 ~]# lsb_release -a
LSB Version:    :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: CentOS
Description:    CentOS Linux release 7.6.1810 (Core)
Release:        7.6.1810
Codename:       Core

 

 

004、上传至linux(或者直接在linux中下载),然后依次执行下面的命令;注意 configure 中增加 --prefix=/usr/选项

tar -xzvf make-4.4.tar.gz
cd make-4.4/
mkdir build
cd build
../configure --prefix=/usr/         ##  此处的--prefix=/usr/是环境变量是否生效的关键
bash build.sh
make
make install

 

004、查看安装后的版本

[root@PC1 build]# make --version
GNU Make 4.4
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

 

安装了最新版本的4.4.