knowledge structure:
Linux application infrastructure
Rpm package information inquiries
Install, upgrade, uninstall, rmp package
Source code compiler installation
(A) Linux application infrastructure
1 relationship, applications and system commands
File Locations
System Command: general / bin and / sbin directory, or as a shell internal command
Applications: usually / usr / bin and / usr / sbin directory to store the application version 7.0 / usr / local
The main purpose
System Commands: perform basic management of the system, such as IP configuration tool
Applications: Complete relatively independent of other supporting tasks, such as web browsers
For the environment
System Command: generally only run in the character operator interface
Application: according to actual needs, some may run in the graphical interface
Run format
System commands: General, including the command word, options, parameters
Applications: Typically there is no fixed format execution
2, the directory structure of a typical application
file type | Save directory |
General execution program file | /usr/bin |
Server executes the program files and manage files | /usr/sbin |
Application configuration file | /etc |
Log Files | / Var / log |
Application Documents | /usr/share/doc |
Applications Manual page file |
/usr/share/man |
3, common package types of packages
file type | Save directory |
rpm package | Extension ".rpm" |
deb package | Extension of ".deb" is generally used for Debian, Ubuntu install dpkg command |
Sources Package | Generally ".tar.gz", ". Tar.bz2" compression format Program source code package comprising |
Green-free installation package | Provides an execution program file compiled numbers in the archive Unzip the file after the package can be used directly (install.sh setup) |
(B) RPM package management tools
RPM Package Manager:
Red Hat made by the company, is used by many Linux distributions
Establishment of a unified database file
Detailed records package is installed, uninstall information and other changes
Automatic analysis package dependencies
RPM packages
Software Reference material: http://www.rpm.org
General naming format:
Added: i386 i686 the x86_64 32-bit 64-bit (64-bit now basically)
1,查询RPM软件包信息
查询已安装的RPM软件信息
rpm -q [字选项] [软件名]
常用选项:
-qa:查看系统中所有安装的软件包
-qi:查看版本信息
-ql:RPM软件包在当前系统中安装的所有目录,文件
-qf:查看指定文件或目录是由哪个软件包创建的
-qc:软件包中的配置文件
-qd:文档手册
查询未安装的RPM软件包文件中信息
rpm -qp [子选项] [rpm包文件]
常用选项:-qpi,-qpl,-qpc,-qpd使用方法如上图所示
2,安装,升级,卸载RPM软件包
安装或升级RPM软件
rpm [选项] RPM包文件...
常用选项:
-i:在当前系统中安装一个新的RPM软件包
[root@localhost Packages]# rpm -ivh lynx-2.8.8-0.3.dev15.el7.x86_64.rpm 警告:lynx-2.8.8-0.3.dev15.el7.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID f4a80eb5: NOKEY 准备中... ################################# [100%] 正在升级/安装... 1:lynx-2.8.8-0.3.dev15.el7 ################################# [100%]
-e:卸载指定名称的软件包
[root@localhost Packages]# rpm -e lynx [root@localhost Packages]# rpm -q lynx 未安装软件包 lynx
-U:检查并升级系统中的某个软件包,若该软件包原来并未安装,则等同于-i选项
-F:检查并更新系统中的某个软件包,若该软件包原来并未安装,则放弃安装
--force:强制执行
--nodeps:在安装或升级,卸载一个软件包时,不检查与其他软件包的依赖关系
-h:在安装或升级软件包的过程中,以“#”号显示安装进度
-v:显示软件安装过程中的详细信息
解决软件包依赖关系方法
安装有依赖关系的多个软件时
被依赖的软件包需要先安装
可同时指定多个.rpm包文件进行安装
卸载有依赖关系的多个软件时
依赖其他程序的软件包需要先卸载
可同时指定多个软件名进行卸载
忽略依赖关系
结合“--nodeps”选项,但可能导致软件异常
3,维护RPM数据库
重建RPM数据库
[root@localhost ~]# rpm --rebuilddb 或者 [root@localhost ~]# rpm --initdb
导入验证公钥
[root@localhost ~]# rpm --import /media/cdrom/RPM-GPG-KEY-CentOS-7
(三)源代码编译概述
使用源代码安装软件的优点
获得最新的软件版本,及时修复bug
根据用户需要,灵活定制软件功能
应用场合举例
安装较新版本的应用程序时
当前安装的程序无法满足需要时
需要为应用程序添加功能新的功能时
编译安装源代码包
Tarball封包
.tar.gz和.tar.bz2格式居多
软件素材参考:sourceforge.net
完整性校验
md5sum校验工具
[root@localhost ~]# md5sum httpd-2.4.25.tar.gz 24fb8b9e36cf131d78caae864fea0f6a httpd-2.4.25.tar.gz
确定源代码编译环境
需安装支持C/C++程序语言的编译器,如:
gcc-4.4.7-4.el6,gcc-c++-4.4.7-4.el6...
编译安装过程
后语:
yum本地仓库的搭建请在下一篇详解
源代码安装具体操作在后续的博客中将具体展现
谢谢大家的阅读!!!