A method, device, terminal and storage medium for repairing a Linux system
By reading and comparing the software installation data of the Linux system, determining the fault type and providing repair options, the fault problem caused by the error operation of the Linux system is solved, and the system is effectively repaired.
Patent Information
- Application Number
- CN202111449589.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-01
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2041-12-01
AI Technical Summary
In the prior art, the RedHat system in Linux system uses the rpm package management mechanism, and users may mistakenly operate to delete or corrupt the software package, causing the system to not run normally, but there is a lack of effective solutions.
A method for repairing Linux systems is proposed. By reading the software installation data of the current underlying software of the Linux system corresponding to the repair request, comparing with the initial software installation data, determining the fault type and providing corresponding repair options, the user confirms and performing the repair.
Repair of Linux systems is realized. By comparing the initial and current software installation data, we determine the fault type and provide corresponding repair options to ensure that the system can return to normal operation.
Smart Images

Figure CN114090052B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of system repair, and particularly to a method, device, terminal and storage medium for repairing a Linux system. Background Art
[0002] In the Linux (an operating system that is free to use and distribute) system, the RedHat system (a Linux system released by Red Hat) adopts the rpm (Red-Hat Package Manager) package management mechanism; due to this management mechanism, during the use process, users may accidentally delete or damage some software packages, or install software package versions outside the system; these operations will cause the system to fail to run properly, but there is currently no corresponding solution for this situation.
[0003] Therefore, there is a need for a solution to solve the problems in the prior art. Summary of the Invention
[0004] In view of this, the present invention provides a method, device, terminal and storage medium for repairing a Linux system to solve the problems in the prior art.
[0005] Specifically, the present invention provides the following specific embodiments:
[0006] An embodiment of the present invention provides a method for repairing a Linux system, including:
[0007] If a repair request is received, read the software installation data of the current system underlying software of the Linux system corresponding to the repair request;
[0008] Compare the current software installation data with the initial software installation data; the initial software installation data stores the data generated when the system underlying software is first installed on the Linux system;
[0009] If it is determined based on the comparison which system underlying software has failed and the type of the failure, provide the user with repair options corresponding to the type of the failure; different repair options correspond to different types of failures;
[0010] If a confirmation instruction for repair is received from the user, perform repair on the system underlying software with the failure based on the repair options.
[0011] In a specific embodiment, the software installation data includes: the name of the system underlying software, the version information of the system underlying software, and the names and hierarchical information of the files generated after the installation of the system underlying software.
[0012] In a specific embodiment, the failure types include: the underlying system software is uninstalled, the files of the underlying system software are lost, the underlying system software is upgraded, and the underlying system software is downgraded;
[0013] The repair options include: reinstalling the underlying system software, downgrading the underlying system software, and upgrading the underlying system software.
[0014] In a specific embodiment, it further includes:
[0015] If the underlying system software with a failure cannot be determined based on the comparison, an option of full reinstallation is provided to the user; the option of full reinstallation is used to reinstall all the underlying system software in the initial software installation data.
[0016] In a specific embodiment, it further includes:
[0017] Count the number of failures of each underlying system software in the Linux system;
[0018] Back up each file generated after installing the underlying system software with a quantity greater than the threshold, so that after the files generated by the original installation are damaged, the underlying system software can be run based on the backed-up files.
[0019] An embodiment of the present invention also provides a device for repairing a Linux system, including:
[0020] A reading module, configured to, if a repair request is received, read the software installation data of the current underlying system software of the Linux system corresponding to the repair request;
[0021] A comparison module, configured to compare the current software installation data with the initial software installation data; the initial software installation data stores the data generated when the underlying system software is first installed on the Linux system;
[0022] An option module, configured to, if the underlying system software with a failure and the failure type are determined based on the comparison, provide the user with repair options corresponding to the failure type; different repair options correspond to different failure types;
[0023] A repair module, configured to, if an instruction for confirming repair from the user is received, perform repair on the underlying system software with a failure based on the repair options.
[0024] In a specific embodiment, the software installation data includes: the name of the underlying system software, the version information of the underlying system software, and the names and hierarchical information of each file generated after the underlying system software is installed.
[0025] In a specific embodiment, the fault types include: the underlying system software is uninstalled, the files of the underlying system software are lost, the underlying system software is upgraded, and the underlying system software is downgraded;
[0026] The repair options include: reinstalling the underlying system software, downgrading the underlying system software, and upgrading the underlying system software.
[0027] An embodiment of the present invention also provides a terminal, including a memory and a processor. An application program is stored in the memory, and when the processor executes the application program, the method for repairing the Linux system as described above is implemented.
[0028] An embodiment of the present invention also provides a storage medium. An application program is stored in the storage medium, and when the application program is executed, the method for repairing the Linux system as described above is implemented.
[0029] Therefore, an embodiment of the present invention provides a method, device, terminal, and storage medium for repairing a Linux system. The method includes: if a repair request is received, reading the software installation data of the current underlying system software of the Linux system corresponding to the repair request; comparing the current software installation data with the initial software installation data; the initial software installation data stores the data generated when the underlying system software was first installed on the Linux system; if it is determined based on the comparison which underlying system software has failed and the type of the fault, then provide the user with repair options corresponding to the type of the fault; different repair options correspond to different fault types; if a confirmation instruction for repair from the user is received, then perform repair on the underlying system software with the fault based on the repair options. In this solution, the underlying system software with the fault and the type of the fault are determined by comparing the initial software installation data with the software installation data of the current underlying system software, and thus, corresponding repair options are provided to the user based on the type of the fault, realizing the repair of the Linux system. Description of the Drawings
[0030] To more clearly illustrate the technical solutions of the present invention, the drawings required for the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as limiting the protection scope of the present invention. In each drawing, similar components are numbered similarly.
[0031] Figure 1 Shows a schematic flowchart of a method for repairing a Linux system proposed by an embodiment of the present invention;
[0032] Figure 2 Shows a schematic structural diagram of a device for repairing a Linux system proposed by an embodiment of the present invention;
[0033] Figure 3 Another structural schematic diagram of a device for repairing a Linux system according to an embodiment of the present invention is shown;
[0034] Figure 4 A third structural schematic diagram of a device for repairing a Linux system according to an embodiment of the present invention is shown.
[0035] Legend description:
[0036] 201 - Reading module; 202 - Comparison module; 203 - Option module; 204 - Repair module;
[0037] 205 - Processing module; 206 - Backup module. Detailed implementation manners
[0038] Hereinafter, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying 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 of the embodiments.
[0039] Generally, the components of the embodiments of the present invention 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 present invention, but merely represents selected embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.
[0040] In the following text, the terms "including", "having" and their cognates that can be used in various embodiments of the present invention are only intended to represent specific features, numbers, steps, operations, elements, components or combinations of the foregoing items, and should not be construed as first excluding the existence of one or more other features, numbers, steps, operations, elements, components or combinations of the foregoing items or increasing the possibility of one or more features, numbers, steps, operations, elements, components or combinations of the foregoing items.
[0041] In addition, the terms "first", "second", "third", etc. are only used for differentiating descriptions and cannot be understood as indicating or implying relative importance.
[0042] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which various embodiments of the present invention pertain. The terms (such as those defined in a commonly used dictionary) will be interpreted as having the same meaning as their contextual meaning in the relevant technical field and will not be interpreted as having an idealized meaning or an overly formal meaning, unless clearly defined in various embodiments of the present invention.
[0043] Embodiment 1
[0044] Embodiment 1 of the present invention discloses a method for repairing a Linux system, as Figure 1 shown, including the following steps:
[0045] Step S101, if a repair request is received, read the software installation data of the current system underlying software of the Linux system corresponding to the repair request;
[0046] Specifically, before step S101, that is, when the Linux system is initially installed, one or more system underlying software will be installed simultaneously. When the system underlying software is initially installed, the data generated by installing these system underlying software will be saved, that is, the initial software installation data. Specifically, the initial software installation data may include the name of the system underlying software, the version information of the system underlying software, and the names and hierarchical information of each file generated after the system underlying software is installed.
[0047] The specific system underlying software is the software at the system bottom layer in the Linux system (different from the software at the general application layer, and the damage of the software at the application layer only affects itself). The system underlying software will affect the normal operation of the Linux system. The system underlying software can be a certain module / sub-software / rpm package of the Linux system.
[0048] When the user finds that the Linux system cannot be started, a repair request will be sent. In this case, the installation data of the current system underlying software of the Linux system will be obtained.
[0049] Step S102, compare the current software installation data with the initial software installation data; the initial software installation data stores the data generated when the system underlying software is first installed on the Linux system;
[0050] By comparing the current software installation data with the initial software installation data, specifically compare the data differences between the two, for example, compare the names of the installed software, the version numbers of the same software, and whether there are differences in the names and hierarchical information of each file generated after the same software is installed;
[0051] If there are differences, it can be confirmed that a fault exists, and the underlying system software with the fault and the corresponding fault type can be determined, and then step S103 is entered.
[0052] Step S103: If it is determined based on the comparison which underlying system software has failed and the fault type, then provide the user with repair options corresponding to the fault type; different repair options correspond to different fault types.
[0053] Specifically, the fault types include: the underlying system software is uninstalled, the files of the underlying system software are lost, the underlying system software is upgraded, and the underlying system software is downgraded; correspondingly, the repair options include: reinstalling the underlying system software, downgrading the underlying system software, and upgrading the underlying system software.
[0054] Specifically, for example, if it is determined by comparison that the software names included in the current software installation data are: Software 2, Software 3, but the software names included in the initial software installation data are: Software 1, Software 2, Software 3; in this case, it can be confirmed that Software 1 has been uninstalled, and thus, the corresponding repair option can be to reinstall Software 1.
[0055] In addition, if it is determined by comparison that the version of Software 2 installed in the current software installation data is 1.1; but the version of Software 2 installed in the initial software installation data is 1.0; then Software 2 needs to be downgraded; if the version of Software 2 installed in the current software installation data is 0.9; then Software 2 needs to be upgraded.
[0056] The new and old of specific versions are distinguished by general numerical magnitudes. If there are other ways to distinguish the new and old of versions, they will not be elaborated here.
[0057] For another example, if it is determined by comparison that the file of Software 2 installed in the initial software installation data has File 3, but File 3 does not exist in the file of Software 2 installed in the current software installation data, then it can be confirmed that the file of Software 2 is lost.
[0058] Step S104: If a confirmation repair instruction from the user is received, then repair the underlying system software with the fault based on the repair option.
[0059] The above steps are the methods for the software with confirmed faults. In addition, if no fault is confirmed based on the comparison, the method further includes: if it is impossible to determine the underlying system software with the fault based on the comparison, then provide the user with an option to reinstall all; the option to reinstall all is used to reinstall all the underlying system software in the initial software installation data.
[0060] Specifically, if it is impossible to confirm the system underlying software with a fault, a repair option for reinstalling all the system underlying software in the initial software installation data can be provided. If this repair option receives a confirmation execution instruction from the user, the reinstallation of all the system underlying software is executed.
[0061] Furthermore, the above steps are the processing flow after a fault occurs. Based on fault prevention, this solution further includes: counting the number of faults occurring in each of the system underlying software in the Linux system; backing up each file generated after installing the system underlying software with a quantity greater than the threshold, so that after the files generated by the original installation are damaged, the system underlying software can be run based on the backed-up files.
[0062] Specifically, the faults that have occurred can be counted to determine which software is particularly prone to faults. For example, when it is determined that Software 2 and Software 3 are particularly prone to faults, the files generated during the initial installation of Software 2 and Software 3 can be backed up so that after the files generated by the original installation are damaged, they can continue to run based on the backed-up files; compared with reinstallation, the time can be greatly shortened, thereby improving the processing efficiency and enhancing the user experience.
[0063] Embodiment 2
[0064] For further illustration of the present invention, Embodiment 2 of the present invention also discloses a device for repairing a Linux system, as Figure 2 shown, including:
[0065] A reading module 201, configured to read the software installation data of the current system underlying software of the Linux system corresponding to the repair request if a repair request is received;
[0066] A comparison module 202, configured to compare the current software installation data with the initial software installation data; the initial software installation data stores the data generated during the first installation of the system underlying software on the Linux system;
[0067] An option module 203, configured to provide a repair option corresponding to the fault type to the user if it is determined based on the comparison that the system underlying software with a fault and the fault type; different repair options correspond to different fault types;
[0068] A repair module 204, configured to execute a repair on the system underlying software with a fault based on the repair option if a confirmation repair instruction from the user is received.
[0069] In a specific embodiment, the software installation data includes: the name of the system underlying software, the version information of the system underlying software, and the name and hierarchical information of each file generated after the system underlying software is installed.
[0070] In a specific embodiment, the fault types include: the underlying system software is uninstalled, the files of the underlying system software are lost, the underlying system software is upgraded, and the underlying system software is downgraded;
[0071] The repair options include: reinstalling the underlying system software, downgrading the underlying system software, and upgrading the underlying system software.
[0072] In a specific embodiment, as Figure 3 shown, the device further includes:
[0073] A processing module 205, configured to provide all reinstallation options to the user if the underlying system software with a fault cannot be determined based on comparison; the all reinstallation options are used to reinstall all the underlying system software in the initial software installation data.
[0074] In a specific embodiment, as Figure 4 shown, the device further includes:
[0075] A backup module 206, configured to count the number of faults occurring in each of the underlying system software in the Linux system;
[0076] Back up each file generated after installing the underlying system software with a quantity greater than the threshold, so that after the files generated by the original installation are damaged, the underlying system software can be run based on the backed-up files.
[0077] Embodiment 3
[0078] Embodiment 3 of the present invention also discloses a terminal, including a memory and a processor, where an application program is stored in the memory, and the processor implements the method for repairing the Linux system described in Embodiment 1 when executing the application program.
[0079] Embodiment 4
[0080] Embodiment 4 of the present invention also discloses a storage medium, where an application program is stored in the storage medium, and the method for repairing the Linux system described in Embodiment 1 is implemented when the application program is executed.
[0081] Accordingly, the solution of the present invention proposes a method, apparatus, terminal, and storage medium for repairing a Linux system. The method includes: if a repair request is received, reading the software installation data of the current system underlying software corresponding to the repair request; comparing the current software installation data with the initial software installation data; the initial software installation data stores the data generated when the system underlying software was first installed on the Linux system; if it is determined based on the comparison which system underlying software has failed and the type of failure, then providing the user with repair options corresponding to the type of failure; different repair options correspond to different types of failures; if an instruction to confirm the repair is received from the user, then repairing the failed system underlying software based on the repair options. In this solution, the system underlying software that has failed and the type of failure are determined by comparing the initial software installation data with the software installation data of the current system underlying software, and accordingly, corresponding repair options are provided to the user based on the type of failure, achieving the repair of the Linux system.
[0082] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and structure diagrams in the drawings show the possible architectures, functions, and operations of the apparatus, method, and computer program products according to multiple embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, program segment, or part of code that contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the blocks may occur in a different order than marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the structure diagram and / or flowchart, as well as the combination of blocks in the structure diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0083] In addition, each functional module or unit in various embodiments of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0084] When the above-mentioned functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs.
[0085] The above is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, which should all be covered by the protection scope of the present invention.
Claims
1. A method for repairing a Linux system, characterized in that, it includes: If a repair request is received, read the software installation data of the current system underlying software of the Linux system corresponding to the repair request; Compare the current software installation data with the initial software installation data; the initial software installation data stores the data generated when the system underlying software was first installed on the Linux system; If it is determined based on the comparison which system underlying software has failed and the type of failure, provide the user with repair options corresponding to the type of failure; Different repair options correspond to different types of failures; If an instruction to confirm the repair is received from the user, perform a repair on the failed system underlying software based on the repair option; The name of the system underlying software, the version information of the system underlying software, and the names and hierarchical information of each file generated after the system underlying software is installed; The types of failures include: the system underlying software is uninstalled, the files of the system underlying software are lost, the system underlying software is upgraded, and the system underlying software is downgraded; The repair options include: reinstalling the system underlying software, downgrading the system underlying software, and upgrading the system underlying software; The step of if it is determined based on the comparison which system underlying software has failed and the type of failure, and then provide the user with repair options corresponding to the type of failure includes: If it is determined by comparison that the number of software names included in the current software installation data is less than the number of software names included in the initial software installation data, confirm that the type of failure is that the system underlying software is uninstalled, and the corresponding repair option is to reinstall the system underlying software; If it is determined by comparison that the version of the software installed in the current software installation data is higher than the version of the software installed in the initial software installation data, determine that the type of failure is that the system underlying software is upgraded, and the corresponding repair option is to downgrade the system underlying software; If it is determined by comparison that the version of the software installed in the current software installation data is lower than the version of the software installed in the initial software installation data, determine that the type of failure is that the system underlying software is downgraded, and the corresponding repair option is to upgrade the system underlying software; If it is determined by comparison that the number of files of the software installed in the initial software installation data is the same as the number of files of the software installed in the current software installation data but the file names are different, determine that the type of failure is that the files of the system underlying software are lost, and the corresponding repair option is to reinstall the system underlying software; Before receiving a repair request and reading the software installation data of the current system underlying software of the Linux system corresponding to the repair request, the method further includes: when the Linux system is initially installed, install at least one system underlying software at the same time, and when the system underlying software is first installed, save the initial software installation data generated by installing the system underlying software.
2. The method according to claim 1, characterized in that, it further includes: If it is impossible to determine which system underlying software has failed based on the comparison, provide the user with an option to reinstall the entire system. All of the reinstallation options are used to reinstall all the low-level system software in the initial software installation data.
3. The method according to claim 1, characterized in that it further includes: counting the number of failures of each of the low-level system software in the Linux system; backing up each file generated after installing the low-level system software with a quantity greater than the threshold, so that after the files generated by the original installation are damaged, the low-level system software can be run based on the backed-up files.
4. A device for repairing a Linux system, characterized in that it includes: a reading module, configured to read the software installation data of the current low-level system software of the Linux system corresponding to the repair request if a repair request is received; a comparison module, configured to compare the current software installation data with the initial software installation data; the initial software installation data stores the data generated when the low-level system software is first installed on the Linux system; an option module, configured to provide a repair option corresponding to the failure type to the user if it is determined based on the comparison that there is a failed low-level system software and the failure type; different repair options correspond to different failure types; the software installation data includes: the name of the low-level system software, the version information of the low-level system software, and the name and hierarchical information of each file generated after the low-level system software is installed; the failure types include: the low-level system software is uninstalled, the file of the low-level system software is lost, the low-level system software is upgraded, and the low-level system software is downgraded; the repair options include: reinstalling the low-level system software, downgrading the low-level system software, and upgrading the low-level system software; specifically, the option module is used for: if it is determined based on the comparison that the number of software names included in the current software installation data is less than the number of software names included in the initial software installation data, it is confirmed that the failure type is that the low-level system software is uninstalled, and the corresponding repair option is to reinstall the low-level system software; if it is determined based on the comparison that the version of the software installed in the current software installation data is higher than the version of the software installed in the initial software installation data, it is determined that the failure type is that the low-level system software is upgraded, and the corresponding repair option is to downgrade the low-level system software; if it is determined based on the comparison that the version of the software installed in the current software installation data is lower than the version of the software installed in the initial software installation data, it is determined that the failure type is that the low-level system software is downgraded, and the corresponding repair option is to upgrade the low-level system software; if it is determined based on the comparison that the number of files of the software installed in the initial software installation data is the same as the number of files of the software installed in the current software installation data but the file names are different, it is determined that the failure type is that the file of the low-level system software is lost, and the corresponding repair option is to reinstall the low-level system software; a repair module, configured to execute a repair on the failed low-level system software based on the repair option if a confirmation repair instruction from the user is received. A data storage module is configured to install at least one system-level software during the initial installation of the Linux system, and when the system-level software is initially installed, save the initial software installation data generated by installing the system-level software.
5. A terminal, characterized in that it includes a memory and a processor, an application program is stored in the memory, and when the processor executes the application program, it implements the method for repairing the Linux system according to any one of claims 1-3.
6. A storage medium, characterized in that an application program is stored in the storage medium, and when the application program is executed, it implements the method for repairing the Linux system according to any one of claims 1-3.
Citation Information
Patent Citations
Remote warning system of engineering machinery device and control method of remote warning system
CN103021142A
Intelligent operation and maintenance management method and system having automatic barrier-reporting function
CN107958347A