Manufacturing method of software offline installation package based on Linux system
By simulating the target environment and packaging the dependency packages in the Linux system, the cumbersome software installation problem of multi-module and multi-service systems is solved, achieving efficient offline installation, simplifying the installation process and saving maintenance workload.
Patent Information
- Application Number
- CN202411357597.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-01-10
AI Technical Summary
In a Linux system environment, the software installation and deployment process for multi-module, multi-service systems is cumbersome, time-consuming, and labor-intensive, especially in non-public network environments where online component installation is difficult.
By simulating the target production environment, the system identifies and downloads dependency packages, packages them into an offline installer, and uses RPM software to achieve offline installation. This includes installing a CentOS 7.6 system in a virtual machine, automatically installing missing dependency packages online, and packaging all dependency packages into a single installation file.
The installation process has been simplified, the workload of operation and maintenance has been reduced, and efficient offline installation has been achieved in non-public network environments, saving time and manpower.
Smart Images

Figure CN119292615A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method for preparing a software offline installation package, and in particular to a method for preparing a software offline installation package based on a Linux system. Background Art
[0002] At present, the development of multi-module and multi-service system-level software, and its installation and deployment in the Linux system environment, will rely on complex components, such as operating environment, database, middleware, management components, etc., and often require a lot of online download and installation processes. The steps are cumbersome, time-consuming and labor-intensive, especially in non-public network environments, the installation of online components encounters various difficulties. Summary of the invention
[0003] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a method for preparing a software offline installation package based on a Linux system.
[0004] The purpose of the present invention is achieved through the following technical solutions:
[0005] The method for making a software offline installation package based on the Linux system is characterized by comprising the following steps:
[0006] 1) Prepare the target installation environment and simulate the target production installation environment;
[0007] 2) Determine the dependency packages required for software installation and install the dependency packages required for the software;
[0008] 3) Determine the installation type of the dependent package;
[0009] Record the dependency packages that need to be installed online and download the recorded dependency packages;
[0010] 4) Package the downloaded dependency packages into the installation package, package all dependency packages into the software installation package, and package all downloaded component installation packages into one installation file to achieve offline installation of the software package.
[0011] Furthermore, in the above-mentioned method for making a software offline installation package based on the Linux system, in step 1), the simulation target production installation environment is:
[0012] In the virtual machine environment, install the CentOS7.6 minimal Linux system to ensure its public network access environment.
[0013] Furthermore, in the above-mentioned method for making an offline software installation package based on the Linux system, in step 2), the software is installed and dependent packages that need to be installed online are recorded;
[0014] When installing the software, the system searches for dependent packages based on the dependent container environment and database. If the dependent package does not exist locally, it is automatically installed online.
[0015] Furthermore, in the above-mentioned method for making a software offline installation package based on the Linux system, the container environment is a tomcat environment.
[0016] Furthermore, in the above-mentioned method for making a software offline installation package based on the Linux system, the database is a MySQL database.
[0017] Furthermore, in the above-mentioned method for making a software offline installation package based on the Linux system, step 3) specifically comprises the following steps:
[0018] S300: Obtain the installation status of the dependent package according to the log information. If the log contains the words "http" or "https" network address when the dependent package is installed, it means that the dependent package needs to be installed online, and then record the name of the dependent package;
[0019] S310: Download the recorded dependency packages, and use the yuminstall-y{dependency package name}--download-only--download-dir. / packtmp command to download the dependency packages to a temporary path respectively.
[0020] Furthermore, in the above-mentioned method for making a software offline installation package based on the Linux system, in step 4), the downloaded dependency package is packaged into the installation package;
[0021] Use the tar command to compress the downloaded dependency packages into an independent file. Before installing the software, use the yum -y localinstall {dependency package path} command to install the dependency packages offline.
[0022] Compared with the prior art, the present invention has significant advantages and beneficial effects, which are specifically embodied in the following aspects:
[0023] ① The present invention realizes offline installation of the entire software package based on offline installation of the RPM software package; pre-downloads the dependent installation package corresponding to the system environment, accurately matches the target environment, reduces compatibility issues, meets the needs of offline installation, integrates the installation package into a single file, and simplifies the installation process;
[0024] ② Download and package all the dependencies required by the software and generate an independent installation file. The installation does not rely on the public network environment, saving time and effort;
[0025] ③ Only one online environment preparation and software installation process is required to create an offline installation package, which simplifies the installation process and saves operation and maintenance workload.
[0026] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or be understood by practicing the specific embodiments of the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0028] Figure 1 : Schematic diagram of the process of the present invention. DETAILED DESCRIPTION
[0029] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents the selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present invention.
[0030] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, directional terms and order terms are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0031] like Figure 1 As shown, the method for making a software offline installation package based on the Linux system includes the following steps:
[0032] 1) Prepare the target installation environment and simulate the target production installation environment;
[0033] In the virtual machine environment, install the CentOS7.6 minimal Linux system to ensure its public network access environment;
[0034] 2) Determine the dependency packages required for software installation and install the dependency packages required for the software;
[0035] When installing the software, the system searches for dependent packages based on the dependent container environment and database. If the dependent package does not exist locally, it is automatically installed online. The container environment is Tomcat and the database is MySQL.
[0036] 3) Determine the installation type of the dependent package;
[0037] Record the dependency packages that need to be installed online and download the recorded dependency packages;
[0038] S300: Obtain the installation status of the dependent package according to the log information. If the log contains the words "http" or "https" network address when the dependent package is installed, it means that the dependent package needs to be installed online, and then record the name of the dependent package;
[0039] S310: Download the recorded dependency packages, and use the yuminstall-y{dependency package name}--download-only--download-dir. / packtmp command to download the dependency packages to a temporary path respectively;
[0040] 4) Package the downloaded dependency packages into the installation package, package all dependency packages into the software installation package, and package all downloaded component installation packages into one installation file to achieve offline installation of the software package;
[0041] Use the tar command to compress the downloaded dependency packages into an independent file. Before installing the software, use the yum -y localinstall {dependency package path} command to install the dependency packages offline.
[0042] Example:
[0043] Step S100, installing the CentOS7.6 minimized system in the virtual machine environment;
[0044] Step S200, execute the yum command to install dependent packages such as jdk, mysql-server, tomcat, nginx, etc.;
[0045] Step S300: If the log shows that a dependency has started downloading, execute:
[0046] Step S310, execute the command yuminstall-y --download-only
[0047] --download-dir. / packtmp{dependency package name}, download the installation package of the dependency package to the / packtmp path;
[0048] Repeat steps S300 and S310 until all dependent packages are installed;
[0049] Step S400, pack all dependent packages under the / packtmp path, command: tar cvfz deps.tar.gz / packtmp / *; install all dependent packages in the new CentOS7.6 minimized system, yum localinstall-y / packtmp / *.
[0050] In summary, the present invention realizes offline installation of the entire software package based on offline installation of the RPM software package; pre-downloads the dependent installation package corresponding to the system environment, accurately matches the target environment, reduces compatibility issues, meets the needs of offline installation, integrates the installation package into a single file, and simplifies the installation process.
[0051] Download and package all the dependencies required by the software together, and generate an independent installation file. The installation does not rely on the public network environment, saving time and effort.
[0052] Only one online environment preparation and software installation process is required to create an offline installation package, which simplifies the installation process and saves operation and maintenance workload.
[0053] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention. It should be noted that similar numbers and letters represent similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.
[0054] The above is only a specific implementation of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
[0055] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
Claims
1. A method for making a software offline installation package based on a Linux system, characterized in that: The following steps are involved: 1) Prepare the target installation environment and simulate the target production installation environment; 2) Determine the dependency packages required for software installation and install the dependency packages required for the software; 3) Determine the installation type of the dependent package; Record the dependency packages that need to be installed online and download the recorded dependency packages; 4) Package the downloaded dependency packages into the installation package, package all dependency packages into the software installation package, and package all downloaded component installation packages into one installation file to achieve offline installation of the software package.
2. The method for making a software offline installation package based on a Linux system according to claim 1, characterized in that: Step 1) simulates the target production installation environment: In the virtual machine environment, install the CentOS7.6 minimal Linux system to ensure its public network access environment.
3. The method for making a software offline installation package based on a Linux system according to claim 1, characterized in that: Step 2), install the software and record the dependent packages that need to be installed online; When installing the software, the system searches for dependent packages based on the dependent container environment and database. If the dependent package does not exist locally, it is automatically installed online.
4. The method for making a software offline installation package based on a Linux system according to claim 3, characterized in that: The container environment is a tomcat environment.
5. The method for making a software offline installation package based on a Linux system according to claim 3, characterized in that: The database is a MySQL database.
6. The method for making a software offline installation package based on a Linux system according to claim 1, characterized in that: Step 3) specifically includes the following steps: S300: Obtain the installation status of the dependent package according to the log information. If the log contains the words "http" or "https" network address when the dependent package is installed, it means that the dependent package needs to be installed online, and then record the name of the dependent package; S310: Download the recorded dependency packages, and use the yuminstall-y{dependency package name}--download-only--download-dir. / packtmp command to download the dependency packages to a temporary path respectively.
7. The method for making a software offline installation package based on a Linux system according to claim 1, characterized in that: Step 4), package the downloaded dependency packages into the installation package; Use the tar command to compress the downloaded dependency packages into an independent file. Before installing the software, use the yum -y localinstall {dependency package path} command to install the dependency packages offline.