[root@b ~]# mkdir /test
[root@b ~]# cd /test
rz //从物理机拷贝压缩包到虚拟机
[root@b test]# ll
total 13452
-rw-r--r--. 1 root root 9756455 Dec 10 2016 Discuz_X2.5_SC_UTF8.zip
-rw-r--r--. 1 root root 3962257 Dec 10 2016 tar-1.29.tar.gz
drwxr-xr-x. 3 root root 4096 Nov 19 22:26 tree-1.7.0
-rw-r--r--. 1 root root 47082 Feb 20 2017 tree-1.7.0.gz
[root@b ~]# mount /dev/sr0 /mnt
mount: /dev/sr0 is write-protected, mounting read-only
[root@b ~]# vim /etc/yum.repos.d/base.repo
[base]
name=base
baseurl=file:///mnt
gpgcheck=0
:wq
[root@b ~]# yum repolist //查看状态值,0不正常,一般为repolist: 4,620
[root@b ~]# yum install gcc* -y // 安装编译环境所需软件
[root@b test]# tar -zxvf tree-1.7.0.gz //解压缩
[root@b test] #cd tree-1.7.0
[root@b test] #make install //编译安装
[root@b test] #tree / -----测试Tree命令能否正常使用
tar备份
[root@haha test]#tar -zxvf tar-1.29.tar.gz
[root@haha test]#mv /usr/bin/tar /usr/bin/tar.bak
[root@haha test]# cd tar-1.29
[root@haha test]ll //c查看有configure
[root@haha tar-1.29]# ./configure //当前目录下执行
[root@haha tar-1.29]rm –rf config.log
[root@haha tar-1.29]$su redhat
[root@haha tar-1.29]$./configure 配置 预编译根据当前环境生成编译配置
[root@haha tar-1.29]$exit //退出redhat用户保证用户是root
[root@haha tar-1.29]#pwd /test/tar-1.29
[root@haha tar-1.29]#make install
[root@haha tar-1.29]cd..
[root@haha test]#hash -r
[root@haha test]#rm -f tree-1.7.0
[root@haha test]#tar -zxvf tree-1.7.0.gz
tar工具可以再次执行