This is the fourth day of my participation in the August More text Challenge. For details, see: August More Text Challenge

A lifelong learner, practitioner, and sharer committed to the path of technology, an original blogger who is busy and sometimes lazy, and a teenager who is occasionally boring and sometimes humorous.

Welcome to search “Jge’s IT Journey” on wechat!

The relationship between Linux commands and applications

  • The execution files for application commands are mostly small and are typically placed in the /bin and /sbin directories. For internal commands, they are often integrated into Bash programs, rather than executing files independently.

  • Command files are usually installed together with the operating system to assist the management of the operating system.

  • The command line is generally used in the general format of “command word option parameter”.

  • The command is run only on the character operation interface.

  • Application execution files are usually stored in /usr/bin, /usr/sbin and /usr/local/bin, /usr/local/sbin and other directories.

  • Applications typically need to be installed outside the operating system to provide functionality that is relatively independent of the operating system, sometimes equating to the concept of “software.”

  • The application generally has no fixed execution format, and the running mode is defined by the program developer.

  • Applications may use graphical interfaces in a variety of forms.

  • Some applications provide execution files that can be run in the same format as Linux commands, so they are often called program commands.

Two, the composition of Linux applications

  • Ordinary executable program files: Generally stored in the “/usr/bin” directory, ordinary users can execute.

  • Server program, hypervisor files: Generally stored in the “/usr/sbin” directory, only administrators can execute.

  • Configuration files: Usually stored in the “/etc” directory. If there are many configuration files, subdirectories will be created.

  • Log files: Generally stored in the /var/log directory.

  • Data such as reference documentation about the application: generally stored in the “/usr/share/doc/” directory.

  • The man man page for execution files and configuration files is generally stored in the “/usr/share/man/” directory.

Iii. Encapsulation type of the software package

Different application software packages can be encapsulated in different types, and different software packages have different installation methods.

3.1 Common Package Encapsulation Types

  • RPM software package: The extension name of the software package is.rpm. The software package can be installed only on Linux operating systems that use the RPM package manager mechanism. To install the RPM package, run the RPM command.

  • DEB: The extension name of the DEB package is.deb. The DEB package can be installed only on Linux oss that use the DPKG mechanism, such as Ubuntu. To install the DEB package, run the DPKG command.

  • Source code package: This package is the original code developed by the programmer, generally made as “.tar.gz” and “.tar.bz2” compressed package files.

  • Porting packages with installation programs: These packages have different extensions, but most of them are in TarBall format. They are executable programs or script files for installation, such as install.sh, setup, etc. You only need to run the installation files to complete installation as prompted by the wizard.

Overview of RPM

The RPM package manager creates a unified file database to record the RPM packages installed, uninstalled, and upgraded on the Linux operating system, and automatically analyzes the dependencies of the packages.

Generally, “Software name-Software version-Number of releases” is used. Operating system type. Hardware architecture type. RPM “.

Main functions of RPM

  • Example Query and verify information about RPM software packages.

  • Install, upgrade, and uninstall the RPM package.

  • Comprehensive management operations such as maintaining RPM database information.

6. RPM package management commands

man rpm Get detailed help information about RPM commands.
-qa Display the list of all software installed using RPM in the current system.
-qi View the name, version, license agreement, and purpose description of a specified software package.
-ql Displays a list of all directories and files where the specified software package is installed in the current system.
-qf View which package installed the specified file or directory.
-qp Example Query the RPM packages that have not been installed.
-qpl View the list of all target directories and files where the software package is to be installed.
-i Install a new RPM package on the current system.
-e Uninstall the specified software package.
-U Check and upgrade a software package in the system. If the software package is not installed, it is the same as the -i option
-F Check and update a software package in the system. If the software package is not installed, abandon the installation.
–force Forcibly install a software package. You can use this option when you need to replace existing software packages and files, or when you need to install software that is older than the software version currently in use.
–nodeps When installing, upgrading, or uninstalling a software package, do not check its dependency on other software packages.
-h During software package installation or upgrade, # is used to display the installation progress.
-v Display detailed information about the software installation process.

Vii. Basic process of compilation and installation

After obtaining the required software source code, the basic installation process includes the steps of unpacking, configuration, compilation and installation. The specific flowchart is as follows:

  • Gz or.tar.bz2. You can use the tar command to decompress the source code package of an open-source software. For a source code package with the “. Gz “extension, it is compressed and not tarred. For such a file, you only need to use the gzip command to decompress it.

  • Configuration: The configuration is done by the ‘configure’ script file in the source directory. The various configuration parameters available can be seen by executing ‘./configure –help ‘in the source directory. Configuration encroaching varies from program to program, but the “–prefix” parameter is common to most open source software. This configuration parameter is used to specify the target folder for software package installation.

  • Compilation: The compilation process is mainly based on the makefile configuration information, source code files are compiled to generate binary program modules, dynamic link libraries, executable files, etc. After the configuration is complete, run the make command in the source directory to compile.

  • Installation: After the compilation is complete, run the make install command to copy the software execution program, configuration file, and help documents to the system, which is the final installation process of the application program. For convenience, the above compilation and installation steps can be executed as a single command, separated by ampersand. make && make install

Recommended reading

99% of Linux operation and maintenance engineers must master the command and use

Common commands of the Oracle database in Linux

Common commands of the vi/vim editor in Linux

In this paper, to the end.


Original is not easy, if you think this article is a little useful to you, please give me a like, comment or forward for this article, because this will be my power to output more quality articles, thanks!

By the way, dig friends remember to give me a free attention yo! In case you get lost and you can’t find me next time.

See you next time!