编译安装案例
#思路:编译安装三大步
- 第一步:运行configure脚本,生成Makefile文件
- 第二步:make
- 第三步:make install
案例:CentOS 7 编译安装 tree1.8
最小化的系统建议安装的包
yum install gcc make autoconf gcc-c++ glibc glibc-devel pcre pcre-devel openssl openssl-devel systemd-devel zlib-devel vim lrzsz tree tmux lsof tcpdump wget net-tools iotop bc bzip2 zip unzip nfs-utils man-pages
安装前准备
先查tree来自哪个包 rpm -qf “which tree”
通过tree详细信息查看tree的官方站点并且下载最新版 rpm -qi tree
#cd /usr/local/src
#把下载的新包放到src下面
#解压包tar xvf tree-1.8.0.tgz
之后所有步骤都在解压后的目录下执行
cd tree-1.8.0/
#1 安装相关的依赖包
[root@centos7 ~]#yum install gcc make
#2 下载源码并解压
[root@centos7 ~]#tar xvf tree-1.8.0.tgz
#这里没有config脚本和makefile in文件,因为config脚本和Makefile in文件目的是为了生成Makefile文件,这里提供了Makefile文件
#3 进入解压缩的目录,README和INSTALL
[root@centos7 ~]#cd tree-1.8.0/
[root@centos7 tree-1.8.0]#cat RE