A software package installation method and device, a computing device and a readable storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-28
- Publication Date
- 2026-08-11
AI Technical Summary
[0017]According to the software package installation method of the present invention, in response to an installation request for a target software package, the first dependencies for installing the target software package that the operating system cannot provide are queried. Then, at least one set of software packages that can provide each first dependency is determined from an aggregated repository including software repositories of multiple distributions of the operating system. Next, a target set is determined from each set of software packages, and each software package in the target set is retrieved from the aggregated repository. Finally, the retrieved software packages are installed, and after installation, the target software package is installed. It is evident that when a user installs any software package, if the current operating system cannot provide all the required dependencies, the present invention retrieves software packages that can provide the missing dependencies from an aggregated repository that includes software repositories of multiple different distributions of the current operating system, thereby completing the installation. This obviously improves the success rate of software package installation for users, thereby enhancing the user experience.
Smart Images

Figure CN115576570B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computers, and more particularly to a software package installation method, apparatus, computing device, and readable storage medium. Background Technology
[0002] In daily work, users frequently need to install various software packages on their computing devices. When a user installs any software package, the computing device checks whether its currently running operating system can provide all the dependencies required to install the package (these dependencies can be provided by other software packages). If not, the user is notified that the package cannot be installed. This phenomenon is particularly common for software packages downloaded from the internet.
[0003] Therefore, a new method for installing software packages is urgently needed to solve the above problems. Summary of the Invention
[0004] Therefore, the present invention provides a software package installation method, apparatus, computing device, and readable storage medium in an attempt to solve or at least alleviate the problems mentioned above.
[0005] According to one aspect of the present invention, a software package installation method is provided, executed in an operating system of a computing device, the method comprising: in response to an installation request for a target software package, querying first dependencies that the operating system cannot provide for installing the target software package; determining at least one set of software packages that can provide the first dependencies from an aggregate repository, the aggregate repository including software repositories for multiple distributions of the operating system; determining a target set from the software package sets and retrieving software packages from the target set from the aggregate repository; installing the retrieved software packages, and, after installation, installing the target software package.
[0006] Optionally, in the software package installation method according to the present invention, determining at least one software package set that can provide each first dependency from the aggregate repository includes: for each first dependency, determining at least one software package that can provide the first dependency from the aggregate repository; combining the determined software packages to obtain at least one first software package combination that can provide each first dependency; for each first software package combination, constructing a first dependency tree with the target software package as the root node and the software packages included therein as leaf nodes; if there exists a first dependency tree where all leaf nodes can be installed on the operating system, then combining all the software packages included therein into a software package set.
[0007] Optionally, the software package installation method according to the present invention further includes: if there is a first dependency tree where leaf nodes cannot be installed on the operating system, then it is designated as a second dependency tree; for each second dependency tree, each leaf node that cannot be installed on the operating system is identified as a parent node, and at least one software package set that can provide the second dependencies missing by each parent node is determined from the aggregate repository; for each software package set, each software package included in it is added to the second dependency tree as a leaf node under the corresponding parent node to obtain a third dependency tree; if there is a third dependency tree where all leaf nodes under the parent node can be installed on the operating system, then all software packages included in it are combined into a software package set.
[0008] Optionally, the software package installation method according to the present invention further includes: if there is a third dependency tree where the leaf nodes under the parent node cannot be installed on the operating system, then continue to use it as a second dependency tree; repeat the above steps of determining the parent node, determining the software package set, and adding until the leaf nodes under the parent node of each obtained third dependency tree can be installed on the operating system; and combine all the software packages included in each third dependency tree into a software package set.
[0009] Optionally, in the software package installation method according to the present invention, determining at least one software package combination set that can provide the second dependencies missing by each parent node from the aggregate repository includes: for each parent node, querying the second dependencies that the operating system cannot provide for installing the parent node, and determining at least one second software package combination that can provide the second dependencies missing by the parent node from the aggregate repository; combining the second software package combinations corresponding to each parent node to obtain a plurality of software package combination sets, wherein each software package combination set includes one second software package combination corresponding to each parent node.
[0010] Optionally, the software package installation method according to the present invention further includes: for each first software package combination or second software package combination determined, detecting whether it includes a software package that conflicts with the operating system; if so, deleting the first software package combination or second software package combination that includes a software package that conflicts with the operating system.
[0011] Optionally, the software package installation method according to the present invention further includes: for each second dependency tree, if a set of software packages that can provide the second dependencies missing from each of its parent nodes cannot be determined from the aggregate repository, then the second dependency tree is deleted.
[0012] Optionally, in the software package installation method according to the present invention, determining the target set from each software package set includes: determining the software package set whose software packages have the highest proportion in the software repository of the current version of the operating system as the target set; or determining the software package set whose software packages have the highest proportion in the software repository of the same release version of the operating system as the target set; or determining the software package set containing the fewest software packages as the target set.
[0013] Optionally, in the software package installation method according to the present invention, determining the target set from each software package set includes: determining the software package set with the fewest corresponding dependency tree layers as the target set.
[0014] According to another aspect of the present invention, a software package installation apparatus is provided, residing in an operating system of a computing device. The apparatus includes: a query module, which, in response to an installation request for a target software package, queries for first dependencies that the operating system cannot provide for installing the target software package; a determination module, adapted to determine from an aggregate repository at least one set of software packages that can provide the first dependencies, the aggregate repository including software repositories for multiple distributions of the operating system; a retrieval module, adapted to determine a target set from the software package sets and retrieve the software packages from the aggregate repository; and an installation module, adapted to install the retrieved software packages and, after installation, install the target software package.
[0015] According to another aspect of the present invention, a computing device is provided, comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, the program instructions including instructions for performing the software package installation method according to the present invention.
[0016] According to another aspect of the present invention, a readable storage medium storing program instructions is provided, which, when read and executed by a computing device, causes the computing device to perform the software package installation method according to the present invention.
[0017] According to the software package installation method of the present invention, in response to an installation request for a target software package, the first dependencies for installing the target software package that the operating system cannot provide are queried. Then, at least one set of software packages that can provide each first dependency is determined from an aggregated repository including software repositories of multiple distributions of the operating system. Next, a target set is determined from each set of software packages, and each software package in the target set is retrieved from the aggregated repository. Finally, the retrieved software packages are installed, and after installation, the target software package is installed. It is evident that when a user installs any software package, if the current operating system cannot provide all the required dependencies, the present invention retrieves software packages that can provide the missing dependencies from an aggregated repository that includes software repositories of multiple different distributions of the current operating system, thereby completing the installation. This obviously improves the success rate of software package installation for users, thereby enhancing the user experience. Attached Figure Description
[0018] To achieve the foregoing and related objectives, certain illustrative aspects are described herein in conjunction with the following description and accompanying drawings. These aspects indicate various ways in which the principles disclosed herein may be practiced, and all aspects and their equivalents are intended to fall within the scope of the claimed subject matter. The foregoing and other objectives, features, and advantages of this disclosure will become more apparent from the following detailed description, taken in conjunction with the accompanying drawings. Throughout this disclosure, the same reference numerals generally refer to the same parts or elements.
[0019] Figure 1 A structural block diagram of a computing device 100 according to an embodiment of the present invention is shown;
[0020] Figure 2 A flowchart of a software package installation method 200 according to an embodiment of the present invention is shown;
[0021] Figure 3 A schematic diagram of the structure of an aggregate warehouse according to an embodiment of the present invention is shown;
[0022] Figure 4 A schematic diagram illustrating a flowchart of a method for determining a software package set according to an embodiment of the present invention;
[0023] Figure 5 A schematic diagram of the structure of a first dependency tree according to an embodiment of the present invention is shown;
[0024] Figure 6 A schematic diagram of the structure of a third dependency tree according to an embodiment of the present invention is shown;
[0025] Figure 7 A schematic diagram of a software package installation method according to yet another embodiment of the present invention is shown;
[0026] Figure 8 A schematic diagram of a software package installation apparatus 800 according to an embodiment of the present invention is shown. Detailed Implementation
[0027] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0028] Figure 1 A block diagram of the physical components (i.e., hardware) of a computing device 100 is shown. In a basic configuration, the computing device 100 includes at least one processing unit 102 and system memory 104. According to one aspect, depending on the configuration and type of the computing device, the system memory 104 includes, but is not limited to, volatile memory (e.g., random access memory), non-volatile memory (e.g., read-only memory), flash memory, or any combination of such memory. According to one aspect, the system memory 104 includes an operating system 105 and program modules 150.
[0029] According to one aspect, operating system 105, for example, is suitable for controlling the operation of computing device 100. Furthermore, the example is practiced in conjunction with graphics libraries, other operating systems, or any other applications, and is not limited to any particular application or system. Figure 1 The basic configuration is illustrated by the components within the dashed lines 108. According to one aspect, the computing device 100 has additional features or functions. For example, according to one aspect, the computing device 100 includes additional data storage devices (removable and / or non-removable), such as disks, optical discs, or magnetic tapes. This additional storage... Figure 1 The middle part is shown by removable storage device 109 and non-removable storage device 110.
[0030] As stated above, according to one aspect, a program module is stored in system memory 104. According to one aspect, the program module may include one or more applications. The invention does not limit the type of application; for example, applications may include: email and contact applications, word processing applications, spreadsheet applications, database applications, slideshow applications, drawing or computer-aided applications, web browser applications, etc. In an embodiment of the invention, the application in the program module may be a software package installation device 800, which is configured to perform the software package installation method 200 of the invention.
[0031] According to one aspect, examples can be practiced on circuits including discrete electronic components, packaged or integrated electronic chips containing logic gates, circuits utilizing microprocessors, or on a single chip containing electronic components or a microprocessor. For example, it can be practiced via wherein... Figure 1 Each or many of the components shown can be implemented as an example by integrating a System-on-a-Chip (SOC) on a single integrated circuit. According to one aspect, such an SOC device may include one or more processing units, graphics units, communication units, system virtualization units, and various application functions, all integrated (or “burned in”) as a single integrated circuit onto a chip substrate. When operating via the SOC, the functions described herein can be operated via dedicated logic integrated on a single integrated circuit (chip) with other components of the computing device 100. Embodiments of the invention can also be implemented using other techniques capable of performing logical operations (e.g., AND, OR, and NOT), including but not limited to mechanical, optical, fluid, and quantum technologies. Additionally, embodiments of the invention can be implemented within a general-purpose computer or in any other circuit or system.
[0032] According to one aspect, the computing device 100 may also have one or more input devices 112, such as a keyboard, mouse, pen, voice input device, touch input device, etc. It may also include output devices 114, such as a monitor, speaker, printer, etc. The foregoing devices are examples and other devices may also be used. The computing device 100 may include one or more communication connections 116 that allow communication with other computing devices 118, such as printing devices, like printers. Examples of suitable communication connections 116 include, but are not limited to: RF transmitters, receivers, and / or transceiver circuitry; Universal Serial Bus (USB); parallel and / or serial ports.
[0033] As used herein, the term computer-readable medium includes computer storage medium. Computer storage medium can include volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information (e.g., computer-readable instructions, data structures, or program modules). System memory 104, removable storage device 109, and non-removable storage device 110 are examples of computer storage media (i.e., memory storage). Computer storage media can include random access memory (RAM), read-only memory (ROM), electrically erasable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical storage, magnetic tape, magnetic tape, disk storage or other magnetic storage devices, or any other article of manufacture that can be used to store information and is accessible by computer device 100. According to one aspect, any such computer storage medium can be part of computing device 100. Computer storage media does not include carrier waves or other transmitted data signals.
[0034] According to one aspect, a communication medium is implemented by computer-readable instructions, data structures, program modules, or other data in a modulated data signal (e.g., a carrier wave or other transmission mechanism), and includes any information transmission medium. According to one aspect, the term "modulated data signal" describes a signal having one or more sets of characteristics or altered in a manner that encodes information in the signal. By way of example and not limitation, a communication medium includes wired media such as wired networks or direct wired connections, and wireless media such as acoustic, radio frequency (RF), infrared, and other wireless media.
[0035] Figure 2 A flowchart of a software package installation method 200 according to an embodiment of the present invention is shown. Method 200 is adapted to install software on a computing device (e.g., Figure 1 The program executes within the operating system of the computing device 100 shown. This operating system can be Linux, or other operating systems such as Unix, Windows, etc., and the present invention does not specifically limit this.
[0036] like Figure 2 As shown, the software package installation method of the present invention begins at 210, in response to an installation request for a target software package, by querying the first dependencies for installing the target software package that the operating system cannot provide. That is, by querying the first dependencies for installing the target software package that are not provided in the software repository of the current release version of the operating system.
[0037] Specifically, a package manager can be used to query the first dependencies required for installing a target software package that are not provided in the software repository of the current distribution of the operating system. For example, the Red Hat Package Manager (RPM) is a package management system for Linux, used to install, uninstall, and manage software packages (typically with the .rpm extension) on Linux systems. Therefore, when the operating system is Linux, the RPM package manager can be used to query the first dependencies required for installing a target software package that are not provided in the software repository of the current distribution of the operating system. It should be noted that this is merely an example, and the specific method for querying the missing first dependencies for installing a target software package is not limited in this invention. In specific embodiments, those skilled in the art can configure the settings according to actual needs.
[0038] Then, step 220 identifies at least one set of software packages from the aggregate repository that can provide each of the first dependencies. The aggregate repository may include software repositories for multiple distributions of the operating system.
[0039] like Figure 3 This diagram illustrates the structure of an aggregated repository according to an embodiment of the present invention, comprising an aggregated repository data layer and a unified query interface layer. The aggregated repository data layer aggregates software repository databases from multiple different distributions of the operating system: CentOS 7Repo DB (software repository database for CentOS 7), CentOS 8Repo DB (software repository database for CentOS 8), Fedora 34Repo DB (software repository database for Fedora 34), and OpenEuler20.03Repo DB (software repository database for OpenEuler20.03Repo DB), providing an easy-to-use single database abstraction. The unified query interface layer encapsulates commonly used query functions for multiple scenarios: querying software packages that provide dependencies, querying dependencies required by software packages, querying dependencies that software packages can provide, and conflict queries. It should be noted that the above is only an example; the aggregated repository data layer can also aggregate software repositories from other distributions of the current operating system, or in some embodiments, it can aggregate multiple software repositories from different distributions of the current operating system. Similarly, the unified query interface layer can also encapsulate other query functions, which are not limited by the present invention.
[0040] Next, the process of identifying packages from the aggregate repository, consisting of packages that can provide each primary dependency, will be described. For example... Figure 4 The diagram illustrates a flowchart of a method for determining a software package set according to an embodiment of the present invention, as shown below.
[0041] 410. For each first dependency, determine at least one software package from the aggregate repository that can provide that first dependency. The same dependency can be provided by different software packages; for example, dependency 1 can be provided by software package B or software package C. Therefore, for each first dependency, there may be multiple software packages that can provide that first dependency.
[0042] 420. Combine the determined software packages to obtain at least one first software package combination that can provide each first dependency. In other words, each first software package combination includes one software package that can provide each first dependency.
[0043] The following example illustrates a scenario where the operating system cannot provide the first dependencies for installing target software package A, namely dependency 1, dependency 2, and dependency 3. For dependency 1, the unified query interface layer identifies packages B and C as providers. For dependency 2, packages D and E provide the necessary dependencies. For dependency 3, package F provides the necessary dependencies. Therefore, the package combination consisting of packages B, D, and F constitutes a first package combination {BDF} that provides all the first dependencies. Similarly, we can obtain first package combinations {BEF}, {CDF}, and {CEF}. In total, we obtain four first package combinations: {BDF}, {BEF}, {CDF}, and {CEF}.
[0044] 430. For each first package combination, construct a first dependency tree with the target package as the root node and its constituent packages as leaf nodes. Continuing with the example above, based on the four first package combinations {BDF}, {BEF}, {CDF}, and {CEF}, four first dependency trees can be constructed. Specifically, target package A is the root node, and packages B, D, and F are its leaf nodes; target package A is the root node, and packages B, E, and F are its leaf nodes; target package A is the root node, and packages C, D, and F are its leaf nodes; target package A is the root node, and packages C, E, and F are its leaf nodes, as follows... Figure 5 .
[0045] 440. If a first dependency tree exists where all leaf nodes can be installed on the operating system, then all the packages included in that tree should be combined into a package set. Each leaf node represents a package. For a package in a leaf node, it is necessary to determine, just like with the target package, whether the current operating system can provide all the dependencies required for its installation, i.e., whether it can be installed on the current operating system. For each first dependency tree, only when all leaf nodes can be installed on the current operating system can the packages included in that tree be combined into a package set.
[0046] For example, taking the five software packages B, C, D, E, and F that can provide the first dependencies 1, 2, and 3 as an example, where B, E, and F can be directly installed on the current operating system, while C and D cannot be directly installed, the first software package combination {BEF} can be considered as a software package set. However, for the first software package combinations {BDF}, {CDF}, and {CEF}, it is necessary to continue searching in the aggregate repository for software packages that can provide the missing dependencies of software package C and the missing dependencies of software package D (i.e., the dependencies for installing software package D that cannot be provided in the current version of the operating system's software repository), which leads to step 450.
[0047] 450. If a first dependency tree exists where leaf nodes cannot be installed on the operating system, then it is considered a second dependency tree. It's important to note that although some leaf nodes in the first dependency tree cannot be installed on the operating system, as long as other packages that can provide the missing dependencies for these leaf nodes can be found in the aggregate repository, and these packages happen to be installable on the operating system, then the installation of the target software can still be completed. Therefore, a first dependency tree containing leaf nodes that cannot be installed on the operating system can be considered a candidate dependency tree (i.e., a second dependency tree).
[0048] 460. For each second dependency tree, identify the leaf nodes that cannot be installed on the operating system as parent nodes, and determine from the aggregate repository at least one set of packages that can provide the second dependencies missing from each parent node.
[0049] Specifically, first, for each parent node, query each second dependency that the operating system cannot provide for installing that parent node (i.e., each second dependency that the parent node is missing), and determine at least one combination of second packages from the aggregate repository that can provide each second dependency that the parent node is missing.
[0050] Based on the above example, it is clear that neither software packages C nor D can be installed on the current operating system. Therefore, the search continues in the aggregate repository for second software package combinations that can provide missing dependencies for software package C, and second software package combinations that can provide missing dependencies for software package D. For example, the missing second dependencies for software package C include dependencies 11 and 12, and the missing second dependency for software package D is dependency 13. The aggregate repository finds software packages C1 and C2 that can provide dependency 11, C3 that can provide dependency 12, and D1 that can provide dependency 13. Therefore, the second software package combinations that can provide the missing second dependencies for parent node C include {C1C3} and {C2C3}, and the second software package combinations that can provide the missing second dependencies for parent node D include {D1}.
[0051] Then, the second software package combinations corresponding to each parent node are combined to obtain several software package combination sets, where each software package combination set includes one second software package combination corresponding to each parent node. Obviously, after combining the second software package combinations {C1C3}, {C2C3}, and {D1}, the resulting software package combination sets are {C1C3D1} and {C2C3D1}.
[0052] It is important to note that for each second dependency tree, if a set of packages that can provide the missing second dependencies of its parent nodes cannot be determined from the aggregate repository, then the second dependency tree is deleted, i.e., this approach is discarded. For example, for parent node package C, if no package that can provide the missing dependencies can be found in the aggregate repository, then the second dependency tree containing package C is deleted.
[0053] 470. For each package set, add each of its included packages as leaf nodes under its corresponding parent node to the second dependency tree to obtain the third dependency tree. Specifically, add packages C1, C3, and D1 from the package set {C1C3D1} as leaf nodes to their respective parent nodes, where the parent node of C1 and C3 is package C, and the parent node of D1 is D. Similarly, add packages C2, C3, and D1 from {C2C3D1} as leaf nodes to their respective parent nodes, where the parent node of C2 and C3 is package C, and the parent node of D1 is D. This results in the following: Figure 6 The third dependency tree 1 and the third dependency tree 2 are shown.
[0054] 480. If a third dependency tree exists where all leaf nodes under the parent node can be installed on the operating system, then all packages included in it are combined into a package set. For example, if all leaf nodes under the parent node in third dependency tree 1 can be installed on the operating system (i.e., packages C1, C3, and D1 can all be installed), then all packages C, D, F, C1, C3, and D1 in third dependency tree 1 are combined into a package set {CDFC1C3D1}. However, if C2 in third dependency tree 2 cannot be installed on the operating system, then the aggregate repository needs to be searched for packages that can provide the missing dependencies for package C2, i.e., proceed to step 490.
[0055] 490. If there is a third dependency tree where the leaf nodes under the parent node cannot be installed on the operating system, then continue to treat it as a second dependency tree and repeat the above steps of determining the parent node, determining the package set, and adding (i.e., repeating 460-480 above, which will not be repeated here) until the leaf nodes under the parent node of each third dependency tree can be installed on the operating system. Combine all the packages included in each third dependency tree into a package set.
[0056] In some embodiments, during the determination of the aforementioned software package sets, after each first or second software package combination is determined, it is also checked whether it includes a software package that conflicts with the operating system. If so, the first or second software package combination that includes a software package that conflicts with the operating system is deleted. Specifically, this can be done through the conflict query interface of the unified query interface layer. For example, after finding the first software package combinations {BDF}, {BEF}, {CDF}, and {CEF}, if a conflict query reveals that software package B will conflict with the operating system, then the first software package combinations {BDF} and {BEF} are deleted; in other words, the software package combination scheme containing software package B is abandoned.
[0057] Once all package sets are found, proceed to step 230 to determine the target set from each package set and retrieve the packages from the aggregate repository. In other words, determine an optimal package set (i.e., the target set) from each package set.
[0058] In some embodiments, the target set can be determined by selecting the set of packages with the highest percentage of packages in the software repository of the current version of the operating system. Alternatively, the target set can be selected by selecting the set of packages with the highest percentage of packages in the software repository of the same distribution version of the operating system. The target set can also be selected by selecting the set of packages containing the fewest packages. Furthermore, the target set can be selected by selecting the set of packages with the fewest dependency tree levels. Of course, the strategy for determining the target set is not limited to these; for example, the target set can also be selected by selecting the set of packages whose versions on the original distribution version are closest to the dependency packages provided by the current operating system. This invention does not limit the strategy for determining the target set. In specific embodiments, those skilled in the art can set the target set according to actual needs.
[0059] Then proceed to step 240, install the retrieved software packages, and after installation, install the target software package.
[0060] This completes the installation of the target software package. It is evident that for software packages whose installation is not supported by the current version of the operating system's software repository, this invention can complete the installation by retrieving a software package from an aggregate repository that provides the missing dependencies.
[0061] To further clarify, in some embodiments, after the target set is determined from the various software package sets, all software package set schemes can be output with the target set listed first for the user to choose from. Specifically, a scheme list is output, which includes all software package sets, with the target set listed first. Then, when the user selects a software package set, in response to the user's selection, the software packages in the selected software package set are retrieved from the aggregate repository and installed, followed by the installation of the target software package.
[0062] To better illustrate the complete implementation process of this invention, this invention combines... Figure 7 Another example is given. In this example, the target software package is an RPM package, that is, a software package that can be managed by an RPM package manager, as detailed below.
[0063] The first step is to obtain the target software package A that the user wants to install, which will serve as the root node of the software package tree T that we are about to build.
[0064] The second step is to analyze the dependencies (i.e., Requires) of the target software package A, and compile a list of dependencies that the operating system cannot provide for installing the target software package A into a list of dependencies to be satisfied.
[0065] The third step involves calling the aggregate repository to query packages that can directly provide the dependencies to be satisfied. This may result in multiple combinations of RPM packages. First, all combinations are checked to confirm if any packages conflict with the current system; if so, the combination is discarded. Next, a combination is selected from the remaining combinations as the first-level leaf node of the package tree T, constructing a multi-branch tree.
[0066] Fourth, repeat the above steps. If a tree of software packages that can be installed on this system can be built, add the tree to the feasible tree list L, and then proceed to the next step. If such a tree cannot be built, proceed directly to the next step.
[0067] The fifth step involves reverting to the previous state based on the history of the tree construction. At each level, the remaining package combinations that were not adopted before are tried. For packages that can be installed, they are added to the feasible tree list L. If they cannot be installed, the attempts continue until all solutions are exhausted.
[0068] Step 6: After exhausting all possible solutions, traverse all package tree solutions in the feasible tree list L, select the most recommended package tree and place it at the top of the list, and then output all package trees for the user to choose from.
[0069] Step 7: When the user selects a package tree, output all nodes on that package tree from bottom to top according to the dependencies, and then install them.
[0070] For specific details regarding the software package installation method in this embodiment, please refer to the above-mentioned method based on... Figures 1 to 6 The description will not be repeated here.
[0071] The present invention also provides a software package installation device. Figure 8 A structural block diagram of a software package installation apparatus 800 according to an embodiment of the present invention is shown, suitable for residing in the operating system of a computing device 100. For example... Figure 8 As shown, the software package installation device includes a query module 810, a determination module 820, a retrieval module 830, and an installation module 840.
[0072] The query module 810 is adapted to query, in response to an installation request for the target software package, the first dependencies that the operating system cannot provide for installing the target software package.
[0073] The determination module 820 is adapted to determine from an aggregate repository at least one set of software packages that can provide each first dependency, the aggregate repository including software repositories for multiple distributions of the operating system.
[0074] The retrieval module 830 is adapted to determine the target set from each software package set and retrieve each software package from the aggregate repository.
[0075] Install module 840 is suitable for installing the retrieved software packages and, after installation, installing the target software package.
[0076] The specific details of the software package installation apparatus 800 according to the present invention are as follows: Figures 1 to 7 The details are disclosed in the description, and will not be repeated here.
[0077] According to the software package installation method of the present invention, in response to an installation request for a target software package, the first dependencies for installing the target software package that the operating system cannot provide are queried. Then, at least one set of software packages that can provide each first dependency is determined from an aggregated repository including software repositories for multiple distributions of the operating system. Next, a target set is determined from each set of software packages, and each software package in the target set is retrieved from the aggregated repository. Finally, the retrieved software packages are installed, and after installation, the target software package is installed. It is evident that when a user installs any software package, if the current operating system cannot provide all the required dependencies, the present invention retrieves software packages that can provide the missing dependencies from an aggregated repository that includes software repositories for multiple different distributions of the current operating system, thereby completing the installation of the software package. This obviously improves the success rate of software package installation for users, thereby enhancing the user experience.
[0078] The various techniques described herein can be implemented in combination with hardware or software, or a combination thereof. Thus, the methods and apparatus of the present invention, or certain aspects or portions thereof, can take the form of program code (i.e., instructions) embedded in a tangible medium, such as a removable hard disk, USB flash drive, floppy disk, CD-ROM, or any other machine-readable storage medium, wherein when the program is loaded into and executed by a machine such as a computer, the machine becomes an apparatus for practicing the present invention.
[0079] When the program code is executed on a programmable computer, the computing device generally includes a processor, a processor-readable storage medium (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device. The memory is configured to store program code; the processor is configured to execute the software package installation method of the present invention according to instructions in the program code stored in the memory.
[0080] By way of example, and not limitation, readable media include readable storage media and communication media. Readable storage media stores information such as computer-readable instructions, data structures, program modules, or other data. Communication media generally embodies computer-readable instructions, data structures, program modules, or other data in the form of modulated data signals such as carrier waves or other transmission mechanisms, and includes any information delivery medium. Any combination of the above is also included within the scope of readable media.
[0081] In the specification provided herein, the algorithms and displays are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used with the examples of this invention. The required structure for constructing such systems is apparent from the above description. Furthermore, this invention is not directed to any particular programming language. It should be understood that the contents of the invention described herein can be implemented using various programming languages, and the above description of specific languages is for the purpose of disclosing the best mode of implementation of the invention.
[0082] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0083] It should be understood that, in order to simplify this disclosure and aid in understanding one or more aspects of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof in the above description of exemplary embodiments of the invention. However, this method of disclosure should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim.
[0084] Those skilled in the art will understand that modules, units, or components of the devices disclosed in the examples herein can be arranged in the devices described in this embodiment, or alternatively, can be located in one or more devices different from the devices in this example. The modules in the foregoing examples can be combined into a single module or, in addition, can be divided into multiple sub-modules.
[0085] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.
[0086] Furthermore, those skilled in the art will understand that although some embodiments described herein include certain features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention and form different embodiments.
[0087] Furthermore, some of the embodiments described herein are methods or combinations of method elements that can be implemented by a processor of a computer system or by other means of performing the functions. Therefore, a processor having the necessary instructions for implementing the methods or method elements forms means for implementing the methods or method elements. Furthermore, the elements described herein in the apparatus embodiments are examples of means for implementing the functions performed by elements for the purposes of carrying out the invention.
[0088] As used herein, unless otherwise specified, the use of ordinal numbers such as “first,” “second,” “third,” etc., to describe ordinary objects merely indicates different instances of similar objects and is not intended to imply that the objects being described must have a given order in time, space, ordering, or any other manner.
[0089] Although the invention has been described with reference to a limited number of embodiments, those skilled in the art will understand from the foregoing description that other embodiments are conceivable within the scope of the invention described herein. Furthermore, it should be noted that the language used in this specification has been chosen primarily for readability and instructional purposes, and not for the purpose of interpreting or limiting the subject matter of the invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the invention is illustrative and not restrictive, and the scope of the invention is defined by the appended claims.
Claims
1. A software package installation method, suitable for execution in the operating system of a computing device, the method comprising: In response to an installation request for the target software package, query the first dependencies that the operating system cannot provide for installing the target software package; Identify at least one set of software packages from an aggregate repository that can provide each of the first dependencies, the aggregate repository including software repositories for multiple distributions of the operating system; Determine the target set from each software package set, and retrieve each software package from the target set from the aggregated repository; Install each of the retrieved software packages, and after installation is complete, install the target software package; The step of determining at least one set of software packages from the aggregate repository that can provide each of the first dependencies includes: For each first dependency, at least one software package that can provide that first dependency is determined from the aggregate repository; The identified software packages are combined to obtain at least one first software package combination that can provide each of the first dependencies; For each first package combination, the target package is used as the root node, and the packages it includes are used as leaf nodes to construct a first dependency tree; If there exists a first dependency tree where all leaf nodes can be installed on the operating system, then all the software packages included in it are combined into a software package set. If there exists a first dependency tree where leaf nodes cannot be installed on the operating system, then it is treated as a second dependency tree. For each second dependency tree, each leaf node that cannot be installed on the operating system is identified as a parent node, and at least one set of software packages that can provide the second dependencies missing by each parent node is determined from the aggregate repository. For each package set, each package it includes is added as a leaf node under the corresponding parent node to the second dependency tree to obtain the third dependency tree; If there exists a third dependency tree where all leaf nodes under a parent node can be installed on the operating system, then all the software packages included in it are combined into a software package set. If there exists a leaf node under a parent node that cannot be installed in the third dependency tree of the operating system, then it continues to be used as the second dependency tree. Repeat the steps of determining the parent node, determining the package set, and adding until the leaf nodes under the parent node of each third dependency tree can be installed on the operating system. All packages included in each third dependency tree are combined into a package set.
2. The method of claim 1, wherein, Determine from the aggregate repository at least one set of software packages that can provide the second dependency missing from each parent node, including: For each parent node, query each second dependency that the operating system cannot provide for installing the parent node, and determine at least one combination of second software packages from the aggregate repository that can provide each second dependency that the parent node is missing; The second software packages corresponding to each parent node are combined to obtain several sets of software package combinations, wherein each set of software package combinations includes a second software package combination corresponding to each parent node.
3. The method as described in claim 2, wherein, Also includes: For each first software package combination or second software package combination identified, it is checked whether it includes a software package that conflicts with the operating system; If so, the first or second package combination that includes packages that conflict with the operating system will be removed.
4. The method according to any one of claims 1-3, wherein, Also includes: For each second dependency tree, if a set of packages that can provide the missing second dependencies of its parent nodes cannot be determined from the aggregate repository, then the second dependency tree is deleted.
5. The method according to any one of claims 1-3, wherein, The target set is determined from each software package set, including: The set of software packages with the highest percentage in the software repository of the current version of the operating system is determined as the target set; or The set of software packages with the highest percentage in the software repository of the same release version of the operating system is determined as the target set; or The set of packages containing the fewest packages is identified as the target set.
6. The method of claim 1, wherein, The target set is determined from each software package set, including: The set of packages with the fewest corresponding dependency tree levels is identified as the target set.
7. A software package installation apparatus residing in an operating system of a computing device, the apparatus comprising: The query module, in response to an installation request for the target software package, queries each first dependency that the operating system cannot provide for installing the target software package; The determining module is adapted to determine from an aggregate repository at least one set of software packages that can provide each of the first dependencies, the aggregate repository including software repositories for multiple distributions of the operating system; The retrieval module is adapted to determine a target set from each software package set and retrieve each software package from the aggregated repository in the target set; The installation module is adapted to install the retrieved software packages and, after installation, install the target software package. The step of determining at least one set of software packages from the aggregate repository that can provide each of the first dependencies includes: For each first dependency, at least one software package that can provide that first dependency is determined from the aggregate repository; The identified software packages are combined to obtain at least one first software package combination that can provide each of the first dependencies; For each first package combination, the target package is used as the root node, and the packages it includes are used as leaf nodes to construct a first dependency tree; If there exists a first dependency tree where all leaf nodes can be installed on the operating system, then all the software packages included in it are combined into a software package set. If there exists a first dependency tree where leaf nodes cannot be installed on the operating system, then it is treated as a second dependency tree. For each second dependency tree, each leaf node that cannot be installed on the operating system is identified as a parent node, and at least one set of software packages that can provide the second dependencies missing by each parent node is determined from the aggregate repository. For each package set, each package it includes is added as a leaf node under the corresponding parent node to the second dependency tree to obtain the third dependency tree; If there exists a third dependency tree where all leaf nodes under a parent node can be installed on the operating system, then all the software packages included in it are combined into a software package set. If there exists a leaf node under a parent node that cannot be installed in the third dependency tree of the operating system, then it continues to be used as the second dependency tree. Repeat the steps of determining the parent node, determining the package set, and adding until the leaf nodes under the parent node of each third dependency tree can be installed on the operating system. All packages included in each third dependency tree are combined into a package set.
8. A computing device, comprising: At least one processor; and A memory storing program instructions configured to be executed by the at least one processor, the program instructions including instructions for performing the method as described in any one of claims 1-6.
9. A readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Software installation method, user equipment, storage medium and device
CN109634617A