1. The relationship between applications and system commands
Roles | System command | application |
---|---|---|
File location | Generally in the /bin and /sbin directories, or shell commands | Usually in the /usr/bin and /usr/sbin directories |
The main purpose | Complete basic management of the system, such as IP configuration tools | Complete other relatively independent auxiliary tasks, such as web browsers |
Applicable environment | Generally only run in the character operation interface | According to actual needs, some programs can be run in the graphical interface |
The operating format generally includes command words, command options and command parameters. There is no fixed execution format
Second, the directory structure of a typical application
file type | Save directory |
---|---|
Common executive file | /usr/bin |
Server execution program file and management program file | /usr/sbin |
Application configuration file | /etc |
Log file | / var / log |
Application Reference Document File | /usr/share/doc |
Application man page file | /usr/share/man |
Three, common package type
file type | Save directory |
---|---|
RPM package | The extension is ".rpm" |
DEB software package | The extension is ".deb" |
Source code package | Compressed packages generally in the format of ".tar.gz" and ".tar.bz2" contain the original code of the program |
Green free installation package | The extensions of the software packages vary, mostly in TarBall format. Provide the compiled executable program file in the compressed package, unzip the compressed package and use it directly |
Four, RPM package management tool
1、Red-Hat Package Manager
(1) Proposed by Red-Hat company and adopted by many Linux distributions;
(2) Establish a unified database file;
(3) Detailed record of software package installation, uninstallation and other changes;
(4) Automatic analysis of software package dependencies .
2. RPM software package
(1) Software material reference: http://www.rpm.org
(2) General naming format: bash (software name)-4.1.2 (version number)-15.el6_4. (number of releases) x86_64 (hardware platform) .rpm (extension)
Five, the format of the rpm command
1. The rpm command can realize almost all management functions of the RPM software package;
2. Execute the "man rpm" command to obtain detailed help information about the rpm command;
3. rpm command function
(1) query and verify the RPM software package Information
(2) Install, upgrade, uninstall RPM software packages
(3) Maintain RPM database information and other comprehensive management operations
Six, the meaning of rpm detailed options
rpm -qa | Display the names of all installed programs |
---|---|
rpm -qi program name | Display detailed information of installed programs |
rpm -ql program name | Display the file list of installed programs |
rpm -qf program name | Query which installation package the installed program belongs to |
rpm -qc program name | List configuration files of installed programs |
rpm -qd program name | List the location of package documentation for installed programs |
rpm -qR program name | List dependent packages and files of installed programs |
rpm -qpi program name | Show detailed information about programs not installed |
rpm -qpl program name | Display file information of programs that are not installed |
rpm -qpf program name | Query which installation package the uninstalled program belongs to |
rpm -qpc program name | Display configuration files of programs that are not installed |
rpm -qpd program name | Show the location of the package documentation for programs that are not installed |
Seven: Query rpm software package information
rpm -q xxx | Check whether the package has been installed |
---|---|
rpm -qa | grep xxx query whether xxx has been installed |
rpm -i | installation |
rpm -e | Uninstall |
rpm -U | Upgrade (regardless of whether the program is installed or not, upgrade it) |
rpm -F | The program must be installed before it can be upgraded |
rpm -force | Mandatory |
rpm -nodeps | Do not check dependencies with other packages |
rpm -v | Display process information |
rpm -h | #Display progress during installation or upgrade |
8. Maintain RPM database
1. Rebuild the RPM database: rpm –rebuilddb or rpm –initdb
2. Import the verification public key: rpm –import/media/cdrom/RPM-GPG-KEY-CentOS-7
Nine, to solve the software package dependency method
1. When installing multiple software with dependencies:
(1)被依赖的软件包需要先安装;
(2)可同时指定多个.rpm包文件进行安装
2、卸载有依赖关系的多个软件时:
(1)依赖其他程序的软件包需要先卸载;
(2)可同时指定多个软件名进行卸载
3、忽略依赖关系
结合“–nodeps”选项,但可能导致软件异常
十、源代码编译概述
1、使用源代码安装软件的优点
(1)获得最新的软件版本,及时修复BUG
(2)根据用户需要,灵活定制软件功能、
2、应用场合举例
(1)、安装较新版本的应用程序时
(2)、当前安装的程序无法满足需要时
(3)、需要为应用程序添加新的功能时
十一:Tarball封包
1、.tar.gz和.tar.bz2格式居多
2、软件素材参考:http://sourceforge.net
十二:完整性校验
md5sum校验工具
十三:确认源代码编译环境
需安装支持C/C++程序语言的编译器,如gcc、gcc-c++、make…………
十四、编译安装过程
十五:./configure配置
1、使用源代码目录中的configure脚本
2、执行“./configure --help”可查看帮助
3、典型的配置选项
–prefix=软件安装目录
十六、make编译与安装
1、编译:执行make命令
2、安装:执行make install命令
3、可输入 make && make install 同时执行
十七、测试、应用、维护软件
1、修改配置文件
2、启动
3、运行lynx 127.0.0.1查看本机Apache运行状态