源码编译安装软件包

前提:系统必须安装:开发工具、开发库。br/>步骤:
1、获取源码包
2、解压
[root@localhost extundelete-0.2.4]# tar -jxvf extundelete-0.2.4.tar.bz2 
3、配置、检测安装环境
br/>[root@localhost extundelete-0.2.4]# cd extundelete-0.2.4/
[root@localhost extundelete-0.2.4]# ./configure 
检查安装环境是否符合需求,如果没有问题,生成:makefile文件
4、编译
#make
5、安装
#make install
6、卸载 在解压的目录执行卸载命令
br/>[root@localhost extundelete-0.2.4]# cd extundelete-0.2.4/
[root@localhost extundelete-0.2.4]# make uninstall
br/>Making uninstall in src
 ( cd '/usr/local/bin' && rm -f extundelete )
[root@localhost extundelete-0.2.4]# ll /usr/local/bin/
总用量 0
7、建议安装方式
为防止卸载时删除不干净,建议安装时在comfigure步骤添加一个:--prefix 参数,这样删除或备份时,直接对这个目录操作就可以了。
br/>[root@localhost ~]# cd extundelete-0.2.4/
[root@localhost extundelete-0.2.4]# make clean    再次编译需执行次命令
Making clean in src
Making clean in .
[root@localhost extundelete-0.2.4]# ./configure --prefix=/usr/local/extundelete-161207 指定安装位置
Configuring extundelete 0.2.4
Writing generated files to disk
[root@localhost extundelete-0.2.4]# make && make install 如果确认编译不会有问题可以一起执行两个命令
br/>[root@localhost ~]# ll /usr/local/extundelete-161207/bin/extundelete
-rwxr-xr-x. 1 root root 1323536 12月  8 21:00 /usr/local/extundelete-161207/bin/extundelete
br/>以后删除只需删除设置的路径即可
[root@localhost local]# pwd
/usr/local
br/>[root@localhost local]# rm -rf extundelete-161207/
[root@localhost local]#
~~~~~
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章