CN114995842B - Method and device for installing operating system and readable storage medium - Google Patents
Method and device for installing operating system and readable storage medium Download PDFInfo
- Publication number
- CN114995842B CN114995842B CN202210917449.9A CN202210917449A CN114995842B CN 114995842 B CN114995842 B CN 114995842B CN 202210917449 A CN202210917449 A CN 202210917449A CN 114995842 B CN114995842 B CN 114995842B
- Authority
- CN
- China
- Prior art keywords
- operating system
- application software
- user application
- software
- information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/4401—Bootstrapping
- G06F9/4406—Loading of operating system
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
Abstract
The embodiment of the application provides a method and a device for installing an operating system and a readable storage medium. The method comprises the following steps: identifying user application software installed in a first operating system, and recording related information of the user application software; determining an installation path of the user application software according to the recorded relevant information of the user application software; deleting system files of a first operating system from the computer equipment, and reserving filter files in the deleting process, wherein the filter files comprise files under the installation path of the user application software and information management files of the user application software recorded by the software package manager; installing system files of a second operating system in the computer equipment; and executing reconfiguration operation on the user application software reserved in the second operating system according to the recorded relevant information of the user application software. According to the method and the device, the user application software which is installed before can still be reserved after the operating system is reinstalled, and the user operation cost is reduced.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for installing an operating system, and a readable storage medium.
Background
The Linux Operating System is a clone System developed based on a UNIX Operating System, is an Operating System based on a multi-user, multi-task, multi-thread and multi-CPU (Central Processing Unit) of a POSIX (Portable Operating System Interface) and UNIX, and can install and run various application software, such as office software, a browser, a document viewer and the like.
However, after the Linux operating system is reinstalled, the application software installed in the old system by the user is also cleared, and the user needs to reinstall the application software one by one, which brings inconvenience to the user.
Disclosure of Invention
The embodiment of the application provides a method and a device for installing an operating system and a readable storage medium, which can still retain the previously installed user application software after the operating system is reinstalled, avoid the situation that a user reinstalls the application software one by one, and reduce the operation cost of the user.
In order to solve the above problem, an embodiment of the present application discloses a method for installing an operating system, which is applied to a computer device, and the method includes:
identifying user application software installed in a first operating system, and recording relevant information of the user application software, wherein the first operating system is an operating system installed in the computer equipment;
determining an installation path of the user application software according to the recorded related information of the user application software;
deleting system files of the first operating system from the computer equipment, and reserving filter files in the deleting process, wherein the filter files comprise files under the installation path of the user application software and information management files of the user application software recorded by a software package manager;
installing system files of a second operating system in the computer device;
and executing reconfiguration operation on the user application software reserved in the second operating system according to the recorded relevant information of the user application software.
On the other hand, the embodiment of the application discloses a device for installing an operating system, which is applied to computer equipment, and the device comprises:
the application information collection module is used for identifying user application software installed in a first operating system and recording related information of the user application software, wherein the first operating system is an operating system installed in the computer equipment;
the deleting and filtering module is used for determining the installation path of the user application software according to the recorded related information of the user application software; deleting the system files of the first operating system from the computer equipment, and reserving filter files in the deleting process, wherein the filter files comprise files under the installation path of the user application software and information management files of the user application software recorded by a software package manager;
the system file installation module is used for installing the system files of the second operating system in the computer equipment;
and the application reconfiguration module is used for executing reconfiguration operation on the user application software reserved in the second operating system according to the recorded relevant information of the user application software.
In yet another aspect, an embodiment of the present application discloses an apparatus for installing an operating system, comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors, the one or more programs comprising instructions for performing one or more of the methods for installing an operating system as described above.
In yet another aspect, an embodiment of the present application discloses a readable storage medium having stored thereon instructions that, when executed by one or more processors of an apparatus, cause the apparatus to perform a method of installing an operating system as described in one or more of the foregoing.
The embodiment of the application has the following advantages:
the method comprises the steps of improving the installation process of a Linux operating system, for computer equipment with an installed first operating system, firstly identifying user application software installed in the first operating system, recording related information of the user application software, and determining the installation path of the user application software according to the recorded related information of the user application software; then deleting the system files of the first operating system from the computer equipment, and reserving filter files in the deleting process, wherein the filter files comprise files under the installation path of the user application software and information management files of the user application software recorded by a software package manager; next installing system files of a second operating system in the computer device; and finally, according to the recorded relevant information of the user application software, carrying out reconfiguration operation on the user application software reserved in the second operating system so as to enable the reserved user application software to take effect. By the embodiment of the application, after the new system (the second operating system) is installed in the computer equipment, the application software installed in the old system (the first operating system) by the user can be reserved in the new system, so that the user can directly use the reserved application software, the user can be prevented from re-executing the operation of installing the application software one by one, and the operation cost of the user can be reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments of the present application will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive exercise.
FIG. 1 is a flow chart of steps of one embodiment of a method of installing an operating system of the present application;
FIG. 2 is a schematic flow chart of one installation operating system of the present application;
FIG. 3 is a block diagram of an embodiment of an apparatus for installing an operating system according to the present application;
FIG. 4 is a block diagram of an apparatus 800 for installing an operating system according to the present application;
fig. 5 is a schematic diagram of a server in some embodiments of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application are capable of operation in sequences other than those illustrated or described herein, and that the terms "first," "second," etc. are generally used in a generic sense and do not limit the number of terms, e.g., a first term can be one or more than one. Furthermore, the term "and/or" in the specification and claims is used to describe an association relationship of associated objects, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. In the embodiments of the present application, the term "plurality" means two or more, and other terms are similar thereto.
Referring to FIG. 1, a flow chart of steps of an embodiment of a method of installing an operating system, applicable to a computer device, of the present application is shown, which may include the steps of:
102, determining an installation path of the user application software according to the recorded related information of the user application software;
103, deleting the system files of the first operating system from the computer equipment, and reserving a filter file in the deleting process, wherein the filter file comprises files under the installation path of the user application software and information management files of the user application software recorded by a software package manager;
and 105, executing reconfiguration operation on the user application software reserved in the second operating system according to the recorded relevant information of the user application software.
In this embodiment, the first operating system refers to an operating system already installed in the computer device, and the second operating system refers to an operating system to be installed in the computer device, that is, the first operating system in the computer device needs to be replaced by the second operating system. In the embodiment of the present application, the first operating system may also be referred to as an old system, and the second operating system may also be referred to as a new system.
The Operating System in the embodiment of the present application refers to a Linux Operating System, and the embodiment of the present application does not limit the type of the Linux Operating System, for example, the Linux Operating System may include, but is not limited to, any one of Debian, ubuntu (wubang), centros (Community Enterprise Operating System), centros, UOS (trusted desktop Operating System), kylin Operating System, and squarer Operating System.
In a specific implementation, the first operating system and the second operating system may be the same operating system, for example, the first operating system and the second operating system are both Debian systems. Further, the first operating system and the second operating system may be the same version of the same operating system, such as reinstallation of an installed operating system in a computer device; alternatively, the first operating system and the second operating system may be different versions of the same operating system, such as upgrading an installed operating system in a computer device. Of course, the first operating system and the second operating system may be different operating systems as long as the same software package manager is used by the first operating system and the second operating system.
The software package manager is a suite management system specially developed for the Linux operating system, and installation, updating and removal of software in the Linux operating system are facilitated. The software package managers of different types of Linux operating systems are different. In an alternative embodiment of the present application, the Package Manager may comprise dpkg (Debian Package Manager) or rpm (Red-Hat Package Manager).
In the specific implementation, the software package manager of the Linux operating system mainly comprises two types, wherein one type is dpkg, and the dpkg is the software package manager of a Debian series operating system; the other is rpm, which is the software package manager for the CentOS family of operating systems.
The computer device may include, but is not limited to, any of the following: the mobile phone comprises a server, a smart phone, a recording pen, a tablet computer, an electronic book reader, an MP3 (dynamic image Experts compress standard Audio Layer 3, moving image Experts Group Audio Layer III) player, an MP4 (dynamic image Experts compress standard Audio Layer 4, moving image Experts Group Audio Layer IV) player, a laptop, a vehicle-mounted computer, a desktop computer, a set-top box, an intelligent television, a wearable device and the like.
In a specific implementation, for a computer device with a first operating system installed, when the first operating system in the computer device needs to be replaced by a second operating system, a system installation disk of the second operating system can be used in the computer device to start an installation program of the second operating system. Further, the installation program may provide two alternative installation modes, including a clear disk installation mode and a replacement installation mode.
When receiving the installation mode of the cleaning disk selected by the user, the installation program executes the method for installing the operating system in the prior art, namely, the hard disk of the computer equipment is re-partitioned and formatted, the data in the hard disk is completely cleaned, and then the second operating system is installed in the hard disk of the computer equipment. The method for clearing the disk installation mode is to clear all data of the first operating system, including application software installed in the first operating system by a user. The user application software does not include application software (hereinafter referred to as system application software) carried by the operating system, and the user application software includes, but is not limited to, any one or more of the following: office class software, browsers, and document viewers, among others.
When receiving the alternative installation mode selected by the user, the installation program executes the method for installing the operating system, namely, the operation of repartitioning and formatting is not executed on the hard disk of the computer equipment, but the system file of the first operating system is deleted from the computer equipment, the filter file is reserved in the deletion process, and then the second operating system is installed in the hard disk of the computer equipment. Thus, user application software that was originally installed in the first operating system may remain after the second operating system is installed. Finally, the installer performs a reconfiguration operation on the retained user application software in the old system in the new system to validate the retained user application software in the new system.
Wherein, the filter file refers to each file that needs to be preserved in the old system (first operating system) of the computer device, such as the related file of the user application software installed in the old system. The filter file may include a file under an installation path of the user application software and an information management file of the user application software recorded by a software package manager.
For convenience of description, in the embodiment of the present application, a Debian series operating system is mainly used as an example, a software package manager of the Debian series operating system is dpkg, and the dpkg uses text files as a database (hereinafter, referred to as a system application management database) to maintain software in the system. The system application management database is used for recording information management files of installed software packages in the system, wherein the software packages refer to installation packages of application software and comprise installation packages of system application software and installation packages of user application software. The information management file comprises information such as the installation state of each software package (such as whether the installation is successful), the name of the software package, the version of the software package, the dependency relationship of the software package and the like.
For the Debian series operating system using a dpkg software package manager, the system application management database is typically maintained in the/var/lib/dpkg directory. For the CentOS family of operating systems that use an rpm package manager, the system application management database is typically maintained under the/var/lib/rpm directory. Therefore, if the first operating system is a Debian series operating system, the information management file of the user application software under the/var/lib/dpkg catalog is used as a filter file; and if the first operating system is a CentOS series operating system, taking the information management file of the user application software in the/var/lib/rpm directory as a filter file.
The information management file of the installed user application software in the old system recorded by the software package manager is used as the filter file, so that after the new system (the second operating system) is installed, the software package manager can know which user application software (including the user application software reserved in the old system) is installed in the current system (the second operating system) and the information such as the installation state, the dependency relationship and the like of the installed user application software by reading the reserved information management file, and the software package manager can uniformly manage and maintain the user application software reserved in the old system and the user application software newly installed in the new system.
In the embodiment of the application, the function realization of reserving the user application software is added in the process of reinstalling the operating system in the computer equipment. Referring to fig. 2, a flowchart illustrating installation of an operating system according to an embodiment of the present application is shown. As shown in fig. 2, in the embodiment of the present application, an original process of installing an operating system is improved, and three functional modules, namely, an application information collection module, a deletion filter module, and an application reconfiguration module, are added, so as to implement a function of retaining user application software installed in an old system.
After the installation program is started, when an alternative installation mode selected by a user is received, the installation program triggers and starts the application information collection module. The application information collection module is used for identifying the installed user application software in the first operating system and recording the relevant information of the user application software. The recorded relevant information of the user application software includes, but is not limited to, any one or more of the following items: name and version of the user application software installed in the first operating system, information management files of the user application software recorded by the software package manager, and the like.
Then, the installation program triggers and starts a deletion filter module when executing the operation of deleting the old system file (the system file of the first operating system), wherein the deletion filter module is used for deleting the old system file and keeping the filter file in the process of deleting the old system file. Specifically, the deleting filtering module determines a filtering file according to the relevant information of the user application software recorded by the application information collecting module, deletes the system file of the first operating system from the computer device, and retains the filtering file in the deleting process. The process does not perform the operations of re-partitioning and formatting on the hard disk of the computer device, but deletes all the files except the filter file under the hard disk system directory of the computer device.
Next, the installer executes an operation of installing a new system file (a system file of the second operating system), and installs the system file of the second operating system into the hard disk system directory of the computer device.
And finally, triggering and starting an application reconfiguration module by the installation program, wherein the application reconfiguration module is used for executing reconfiguration operation on the user application software installed in the old system reserved in the new system according to the relevant information of the user application software recorded by the application information collection module so as to enable the reserved user application software to take effect in the new system. At this time, the installation process of the new system (second operating system) is completed in the computer device, and the user application software installed in the old system (first operating system) is retained.
The installation process of the Linux operating system is improved, and the application software installed in the old system (the first operating system) by the user can be still reserved in the new system after the new system (the second operating system) is installed in the computer equipment, so that the user can directly use the reserved application software, the operation that the user re-executes the application software installation one by one can be avoided, and the operation cost of the user is reduced.
In an optional embodiment of the present application, the identifying the user application software installed in the first operating system in step 101 may include:
step S11, executing a first command in the installation directory environment of the first operating system to obtain information of all software packages installed in the first operating system;
step S12, executing the first command under the mirror image mounting catalog environment of the second operating system to obtain the information of all the software packages installed in the second operating system;
step S13, comparing the information of all the software packages installed in the first operating system with the information of all the software packages installed in the second operating system to obtain the information of the installed software packages in the first operating system relative to the excess software packages in the second operating system;
and S14, determining the user application software installed in the first operating system according to the information of the excessive installed software packages.
After the installation program is started, when an alternative installation mode selected by a user is received, the installation program triggers and starts an application information collection module, the application information collection module identifies the installed user application software in the first operating system by executing the steps S11 to S14, and records the relevant information of the identified installed user application software.
The first command is a command carried by the software package manager. The first command is different for software package managers in different operating systems. Specifically, for a software package manager (dpkg) in the Debian series operating system, the first command is a "dpkg-i" command. For the software package manager (rpm) of the CentOS family of operating systems, the first command is the "rpm-qa" command.
And executing the first command in the current system environment to acquire information of all software packages installed in the current system environment, wherein the software packages refer to installation packages of application software and comprise installation packages of system application software and installation packages of user application software. The information of the software package may include, but is not limited to, the name and version number of the application software.
By executing the first command in the installation directory environment of the first operating system, information of all software packages installed in the first operating system can be obtained, for example, information of all software packages installed in the first operating system is recorded as a file 1. By executing the first command in the mirror mount directory environment of the second operating system, information of all software packages installed in the second operating system can be obtained, for example, the information of all software packages installed in the second operating system is recorded as a file 2.
Comparing the information of all the software packages installed in the first operating system with the information of all the software packages installed in the second operating system, that is, comparing the file 1 with the file 2, the information of the installed software packages in the first operating system relative to the excess installed software packages in the second operating system can be obtained, for example, the information of the excess installed software packages is recorded as a file 3, and the file 3 is the information of the software packages of the user application software installed in the first operating system, so that which user application software and the number of the version number are installed in the first operating system can be known, and a realization basis is provided for retaining the user application software.
In an optional embodiment of the present application, the information related to the user application software may include a name of the user application software, and the determining 102 an installation path of the user application software according to the recorded information related to the user application software may include:
and taking the name of the user application software as an input parameter, executing a second command in the installation directory environment of the first operating system, and outputting the installation path of the user application software corresponding to the input parameter through the second command.
The second command is a command carried by the software package manager. The second command is different for software package managers in different operating systems. Specifically, for a software package manager (dpkg) in the Debian series operating system, the second command is a "dpkg-L import parameters" command. For the software package manager (rpm) of the CentOS family of operating systems, the second command is the "rpm-ql input parameters" command.
And taking the identified and recorded name of the installed user application software as an input parameter, executing the second command in the installation directory environment of the first operating system, and outputting the installation path of the user application software corresponding to the input parameter through the second command. For each user application software installed in the first operating system, the second command is executed respectively, an installation path of each user application software can be obtained, and if the installation path is marked as a file 4, the file 4 is used as a filter file. Therefore, the installation path of each user application software can be obtained, namely the installation position of each user application software in the hard disk of the computer equipment is found, so that all files under the installation path of each user application software can be reserved when the operating system is reinstalled, and further each installed user application software can be reserved.
In an optional embodiment of the present application, the filter file may further include a user home directory file in the first operating system and/or a system general configuration file, where the system general configuration file includes a file under a network configuration directory and/or a file under a printer configuration directory.
In the embodiment of the present application, the filter file may include a user's home directory file and/or a system general configuration file in addition to the file (such as all the files in file 4) under the installation path of the identified installed user application software and the information management file of the user application software recorded by the software package manager. The user home directory file refers to a file in a home directory. The system general configuration files include, but are not limited to, files under a network configuration directory and/or files under a printer configuration directory. The file under the network configuration directory refers to the file under the/etc/network directory, and the file under the printer configuration directory refers to the file under the/etc/cups directory.
By the method for installing the operating system, after a new system is installed in the computer equipment, the user application software installed in the old system can be reserved, the user files in the old system/in the home directory can be reserved, and the conventional configuration mode of the system in the old system can be reserved, so that the original use habit of the user can be reserved, the configuration operation of the user is reduced, and the operation cost of the user is further reduced.
In an optional embodiment of the present application, before the deleting, in step 103, the system file of the first operating system from the computer device, the method may further include:
s21, displaying a preset interface, wherein selectable filtering file options are displayed in the preset interface, and the filtering file options comprise any one or more of the following items: a user application software option installed in the first operating system, a system conventional configuration option, and a user home directory option;
and S22, determining a filter file according to the selection operation aiming at the filter file option.
Further, after determining the filter files, the delete filter module may further display a preset interface, where the preset interface is used to display filter file options that can be selected by a user, and each filter file option may correspond to one selectable filter file. Through the preset interface, the content in the old system which can be reserved after the operating system is reinstalled can be shown to the user. Alternatively, the content presented in the preset interface for the user to select may include two broad categories, one category is reserved content about the user application software, including the user application software installed in the old system and the information management file about the installed user application software in the software package manager. The other is the reserved content for the regular settings, including the user's home directory files and the system's regular configuration files. It will be appreciated that the retained content with respect to the user applications may be further subdivided so that the user may select one or more of the user applications that require retention.
According to the selection operation of the user on the filter file option in the preset interface, the filter file needing to be reserved can be determined, so that the flexibility of the reserved content types can be increased, the requirements of different users can be met, and the user experience can be improved.
In an optional embodiment of the present application, the performing, according to the recorded related information of the user application software in step 105, a reconfiguration operation on the user application software reserved in the second operating system may include:
s31, acquiring the name of the user application software according to the recorded related information of the user application software;
and step S32, taking the name of the user application software as an input parameter, executing a third command in the installation directory environment of the second operating system, and executing reconfiguration operation on the user application software corresponding to the input parameter in the second operating system through the third command.
And after the installation program installs the system files of the second operating system into the hard disk system directory of the computer equipment, triggering and starting the application reconfiguration module to execute reconfiguration operation on the user application software in the old system reserved in the new system. The application reconfiguration module performs the reconfiguration operation through the above-described steps S31 and S32.
Specifically, the application reconfiguration module first scans the relevant information (e.g. file 3) of the user application software recorded by the application information collection module to obtain the name of each user application software installed in the old system. And then, taking the acquired name of the user application software as an input parameter, executing a third command in an installation directory environment of a current operating system (a second operating system), and executing reconfiguration operation on the user application software corresponding to the input parameter in the second operating system through the third command.
The reconfiguration operation is used to re-execute the configuration process once the application software is installed. When the application software is installed, some dynamic data, such as configuration files and the like, can be generated by executing the installation configuration scripts in the software package. Since dynamic data cannot be retained when the operating system is reinstalled, it is necessary to perform a reconfiguration operation on each user application software installed in the old system retained in the new system after the reinstallation of the operating system. And performing reconfiguration operation on certain application software, namely performing reconfiguration operation on the installation configuration script in the software package of the application software once again to generate dynamic data of the application software so as to enable each reserved user application software to be effective in the new system.
The third command is a command carried by the software package manager. The third command is different for software package managers in different operating systems. Specifically, for a software package manager (dpkg) in the Debian-family operating system, the third command is a "dpkg-reconfigure import parameter" command. The installation configuration script of the application software corresponding to the input parameter can be executed through the command. For a software package manager (rpm) of a CentOS series operating system, the third command is "rpm-q — scripts input parameters", through which an installation configuration script of application software corresponding to the input parameters can be queried, and then the installation configuration script can be executed in an installation directory environment of the second operating system.
In summary, the installation process of the Linux operating system is improved, for a computer device with an installed first operating system, the installed user application software in the first operating system is firstly identified, the related information of the user application software is recorded, and the installation path of the user application software is determined according to the recorded related information of the user application software; then deleting the system files of the first operating system from the computer equipment, and reserving filter files in the deleting process, wherein the filter files comprise files under the installation path of the user application software and information management files of the user application software recorded by a software package manager; next installing system files of a second operating system in the computer device; and finally, according to the recorded relevant information of the user application software, carrying out reconfiguration operation on the user application software reserved in the second operating system so as to enable the reserved user application software to take effect. By the embodiment of the application, after the new system (the second operating system) is installed in the computer equipment, the application software installed in the old system (the first operating system) by the user can be reserved in the new system, so that the user can directly use the reserved application software, the user can be prevented from re-executing the operation of installing the application software one by one, and the operation cost of the user can be reduced.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the embodiments are not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the embodiments. Further, those skilled in the art will also appreciate that the embodiments described in the specification are presently preferred and that no particular act is required of the embodiments of the application.
Referring to fig. 3, a block diagram of an embodiment of an apparatus for installing an operating system according to the present application is shown, where the apparatus is applied to a computer device, and the apparatus may include:
an application information collecting module 201, configured to identify user application software installed in a first operating system, and record relevant information of the user application software, where the first operating system is an operating system installed in the computer device;
a delete filter module 202, configured to determine, according to the recorded relevant information of the user application software, an installation path of the user application software; deleting the system files of the first operating system from the computer equipment, and reserving filter files in the deleting process, wherein the filter files comprise files under the installation path of the user application software and information management files of the user application software recorded by a software package manager;
a system file installation module 203, configured to install a system file of a second operating system in the computer device;
the application reconfiguration module 204 is configured to execute a reconfiguration operation on the user application software reserved in the second operating system according to the recorded relevant information of the user application software.
Optionally, the application information collecting module includes:
the first operation sub-module is used for executing a first command under the installation directory environment of the first operating system to obtain information of all software packages installed in the first operating system;
the second operation submodule is used for executing the first command under the mirror image mounting directory environment of the second operating system to obtain the information of all the software packages installed in the second operating system;
an information comparison submodule, configured to compare information of all software packages installed in the first operating system with information of all software packages installed in the second operating system, so as to obtain information of installed software packages that are excessive in the first operating system relative to the second operating system;
and the information determining submodule is used for determining the user application software installed in the first operating system according to the information of the excessive installed software packages.
Optionally, the related information of the user application software includes a name of the user application software, and the deletion filtering module is specifically configured to execute a second command in the installation directory environment of the first operating system by using the name of the user application software as an input parameter, and output an installation path of the user application software corresponding to the input parameter through the second command.
Optionally, the application reconfiguration module includes:
the name acquisition submodule is used for acquiring the name of the user application software according to the recorded related information of the user application software;
and the configuration operation sub-module is used for taking the name of the user application software as an input parameter, executing a third command in the installation directory environment of the second operating system, and executing reconfiguration operation on the user application software corresponding to the input parameter in the second operating system through the third command.
Optionally, the apparatus further comprises:
the interface display module is used for displaying a preset interface, selectable filtering file options are displayed in the preset interface, and the filtering file options comprise any one or more of the following items: a user application software option installed in the first operating system, a system conventional configuration option, and a user home directory option;
and the file determining module is used for determining the filter files according to the selection operation aiming at the filter file options.
Optionally, the software package manager comprises a Debian software package manager or a red hat software package manager.
Optionally, the filter file further includes a user home directory file and/or a system normal configuration file in the first operating system, and the system normal configuration file includes a file under a network configuration directory and/or a file under a printer configuration directory.
The method and the device improve the installation process of the Linux operating system, and add three functional modules, namely an application information collection module, a deletion filter module and an application reconfiguration module, to the computer equipment with the installed first operating system so as to realize the function of keeping the application software of the user. Before installing the second operating system in the computer equipment, firstly, identifying the installed user application software in the first operating system through an application information collecting module, and recording the relevant information of the user application software. The deleting and filtering module determines the installation path of the user application software according to the relevant information of the user application software recorded by the application information collecting module; deleting system files of the first operating system from the computer equipment, and reserving filter files in the deleting process, wherein the filter files comprise files under the installation path of the user application software and information management files of the user application software recorded by a software package manager; next, the installation program installs system files of a second operating system in the computer equipment; and finally, the application reconfiguration module executes reconfiguration operation on the user application software reserved in the second operating system according to the recorded relevant information of the user application software so as to enable the reserved user application software to take effect. By the embodiment of the application, after the new system (the second operating system) is installed in the computer equipment, the application software installed in the old system (the first operating system) by the user can be reserved in the new system, so that the user can directly use the reserved application software, the user can be prevented from re-executing the operation of installing the application software one by one, and the operation cost of the user can be reduced.
For the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for relevant points.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
The present embodiments provide an apparatus for installing an operating system, comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors, the one or more programs comprising instructions for performing the method for installing an operating system as described in one or more of the embodiments above.
FIG. 4 is a block diagram illustrating an apparatus 800 for installing an operating system in accordance with an exemplary embodiment. For example, the apparatus 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 4, the apparatus 800 may include one or more of the following components: processing component 802, memory 804, power component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and communication component 816.
The processing component 802 generally controls overall operation of the device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing elements 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operation at the device 800. Examples of such data include instructions for any application or method operating on device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The multimedia component 808 includes a screen that provides an output interface between the device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 800 is in an operational mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, audio component 810 includes a Microphone (MIC) configured to receive external audio signals when apparatus 800 is in an operational mode, such as a call mode, a recording mode, and a voice information processing mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the device 800. For example, the sensor assembly 814 may detect the open/closed state of the device 800, the relative positioning of components, such as a display and keypad of the apparatus 800, the sensor assembly 814 may also search for a change in the position of the apparatus 800 or a component of the apparatus 800, the presence or absence of user contact with the apparatus 800, orientation or acceleration/deceleration of the apparatus 800, and a change in the temperature of the apparatus 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object in the absence of any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate communications between the apparatus 800 and other devices in a wired or wireless manner. The device 800 may access a wireless network based on a communication standard, such as WiFi,2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on radio frequency information processing (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 804 comprising instructions, executable by the processor 820 of the device 800 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Fig. 5 is a schematic diagram of a server in some embodiments of the present application. The server 1900 may vary widely by configuration or performance and may include one or more Central Processing Units (CPUs) 1922 (e.g., one or more processors) and memory 1932, one or more storage media 1930 (e.g., one or more mass storage devices) storing applications 1942 or data 1944. Memory 1932 and storage medium 1930 can be, among other things, transient or persistent storage. The program stored in the storage medium 1930 may include one or more modules (not shown), each of which may include a sequence of instructions operating on a server. Still further, a central processor 1922 may be provided in communication with the storage medium 1930 to execute a series of instruction operations in the storage medium 1930 on the server 1900.
The server 1900 may also include one or more power supplies 1926, one or more wired or wireless network interfaces 1950, one or more input-output interfaces 1958, one or more keyboards 1956, and/or one or more operating systems 1941, such as Windows Server, mac OS XTM, unixTM, linuxTM, freeBSDTM, etc.
A non-transitory computer-readable storage medium in which instructions, when executed by a processor of an apparatus (server or terminal), enable the apparatus to perform the method of installing an operating system shown in fig. 1.
A non-transitory computer-readable storage medium, wherein when instructions in the storage medium are executed by a processor of an apparatus (server or terminal), the apparatus is enabled to perform the description of the method for installing an operating system in the embodiment corresponding to fig. 1, and therefore, the description will not be repeated here. In addition, the beneficial effects of the same method are not described in detail. For technical details not disclosed in the embodiments of the computer program product or the computer program referred to in the present application, reference is made to the description of the embodiments of the method of the present application.
Further, it should be noted that: embodiments of the present application also provide a computer program product or computer program, which may include computer instructions, which may be stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor can execute the computer instruction, so that the computer device performs the description of the method for installing the operating system in the embodiment corresponding to fig. 1, which is described above, and therefore, the description thereof will not be repeated here. In addition, the beneficial effects of the same method are not described in detail. For technical details not disclosed in the embodiments of the computer program product or the computer program referred to in the present application, reference is made to the description of the embodiments of the method of the present application.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.
The method for installing the operating system, the device for installing the operating system, and the readable storage medium provided by the present application are described in detail above, and specific examples are applied herein to illustrate the principles and embodiments of the present application, and the description of the above embodiments is only used to help understand the method and the core ideas of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.
Claims (10)
1. A method for installing an operating system, applied to a computer device installed with a Linux operating system, the method comprising:
identifying user application software installed in a first operating system, and recording related information of the user application software, wherein the first operating system is an operating system installed in the computer equipment;
determining an installation path of the user application software according to the recorded relevant information of the user application software;
deleting the system files of the first operating system from the computer equipment, and reserving filter files in the deleting process, wherein the filter files comprise files under the installation path of the user application software and information management files of the user application software recorded by a software package manager; the filtering files are reserved in the deleting process, the process does not execute operations of re-partitioning and formatting on the hard disk of the computer equipment, and other files except the filtering files in the hard disk system directory of the computer equipment are deleted;
installing system files of a second operating system in the computer device; the first operating system and the second operating system use the same software package manager;
according to the recorded relevant information of the user application software, carrying out reconfiguration operation on the user application software reserved in the second operating system;
the identifying the installed user application software in the first operating system comprises:
executing a first command in an installation directory environment of the first operating system to obtain information of all software packages installed in the first operating system;
executing the first command under the mirror image mounting directory environment of the second operating system to obtain the information of all software packages installed in the second operating system;
comparing the information of all the software packages installed in the first operating system with the information of all the software packages installed in the second operating system to obtain the information of the installed software packages in the first operating system relative to the software packages which are added in the second operating system;
and determining the installed user application software in the first operating system according to the information of the excessive installed software packages.
2. The method according to claim 1, wherein the information related to the user application software comprises a name of the user application software, and the determining the installation path of the user application software according to the recorded information related to the user application software comprises:
and taking the name of the user application software as an input parameter, executing a second command in the installation directory environment of the first operating system, and outputting the installation path of the user application software corresponding to the input parameter through the second command.
3. The method according to claim 1, wherein the performing a reconfiguration operation on the user application software reserved in the second operating system according to the recorded related information of the user application software comprises:
acquiring the name of the user application software according to the recorded related information of the user application software;
and taking the name of the user application software as an input parameter, executing a third command in the installation directory environment of the second operating system, and executing reconfiguration operation on the user application software corresponding to the input parameter in the second operating system through the third command.
4. The method of claim 1, wherein prior to said deleting the system files of the first operating system from the computer device, the method further comprises:
displaying a preset interface, wherein selectable filtering file options are displayed in the preset interface, and the filtering file options comprise any one or more of the following items: a user application software option installed in the first operating system, a system conventional configuration option, and a user home directory option;
and determining a filter file according to the selection operation aiming at the filter file option.
5. The method of any one of claims 1 to 4, wherein the software package manager comprises a Debian software package manager or a Red hat software package manager.
6. The method of any of claims 1 to 4, wherein the filter file further comprises a user home directory file and/or a system regular configuration file in the first operating system, and wherein the system regular configuration file comprises a file under a network configuration directory and/or a file under a printer configuration directory.
7. An apparatus for installing an operating system, applied to a computer device installed with a Linux operating system, the apparatus comprising:
the application information collection module is used for identifying user application software installed in a first operating system and recording related information of the user application software, wherein the first operating system is an operating system installed in the computer equipment;
the deleting and filtering module is used for determining the installation path of the user application software according to the recorded relevant information of the user application software; deleting the system files of the first operating system from the computer equipment, and reserving filter files in the deleting process, wherein the filter files comprise files under the installation path of the user application software and information management files of the user application software recorded by a software package manager; the filtering files are reserved in the deleting process, the process does not execute operations of re-partitioning and formatting on the hard disk of the computer equipment, and other files except the filtering files in the hard disk system directory of the computer equipment are deleted;
the system file installation module is used for installing system files of a second operating system in the computer equipment; the first operating system and the second operating system use the same software package manager;
the application reconfiguration module is used for executing reconfiguration operation on the user application software reserved in the second operating system according to the recorded relevant information of the user application software;
the application information collection module comprises:
the first operation submodule is used for executing a first command under the installation directory environment of the first operating system to obtain information of all software packages installed in the first operating system;
the second operation submodule is used for executing the first command under the mirror image mounting directory environment of the second operating system to obtain the information of all the software packages installed in the second operating system;
an information comparison submodule, configured to compare information of all software packages installed in the first operating system with information of all software packages installed in the second operating system, so as to obtain information of installed software packages that are excessive in the first operating system relative to the second operating system;
and the information determining submodule is used for determining the user application software installed in the first operating system according to the information of the excessive installed software packages.
8. An apparatus for installing an operating system, comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors, the one or more programs comprising instructions for performing the method of installing an operating system of any of claims 1-6.
9. A readable storage medium having stored thereon instructions which, when executed by one or more processors of an apparatus, cause the apparatus to perform a method of installing an operating system as claimed in any one of claims 1 to 6.
10. A computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of installing an operating system of any of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210917449.9A CN114995842B (en) | 2022-08-01 | 2022-08-01 | Method and device for installing operating system and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210917449.9A CN114995842B (en) | 2022-08-01 | 2022-08-01 | Method and device for installing operating system and readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114995842A CN114995842A (en) | 2022-09-02 |
CN114995842B true CN114995842B (en) | 2022-11-01 |
Family
ID=83021610
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210917449.9A Active CN114995842B (en) | 2022-08-01 | 2022-08-01 | Method and device for installing operating system and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114995842B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1735859A (en) * | 2003-05-08 | 2006-02-15 | 富士通株式会社 | The storage medium of software composition recovery method and device and embodied on computer readable |
CN103049287A (en) * | 2012-12-10 | 2013-04-17 | 东莞宇龙通信科技有限公司 | Mobile terminal and method for installing application programs of mobile terminal |
CN104252372A (en) * | 2014-09-19 | 2014-12-31 | 北京数字天域科技股份有限公司 | Methods, devices and system for generating application reservation lists and deleting pre-installed applications |
WO2019224574A1 (en) * | 2018-05-21 | 2019-11-28 | Telefonaktiebolaget Lm Ericsson (Publ) | Ims-based streaming framework |
CN112230947A (en) * | 2019-06-28 | 2021-01-15 | 中科方德软件有限公司 | Upgrading method and upgrading system of operating system |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN100447742C (en) * | 2006-02-20 | 2008-12-31 | 联想(北京)有限公司 | Method for automatically installing operating system |
CN110543312B (en) * | 2018-05-29 | 2022-03-25 | 华为技术有限公司 | Application software installation method and device and server |
-
2022
- 2022-08-01 CN CN202210917449.9A patent/CN114995842B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1735859A (en) * | 2003-05-08 | 2006-02-15 | 富士通株式会社 | The storage medium of software composition recovery method and device and embodied on computer readable |
CN103049287A (en) * | 2012-12-10 | 2013-04-17 | 东莞宇龙通信科技有限公司 | Mobile terminal and method for installing application programs of mobile terminal |
CN104252372A (en) * | 2014-09-19 | 2014-12-31 | 北京数字天域科技股份有限公司 | Methods, devices and system for generating application reservation lists and deleting pre-installed applications |
WO2019224574A1 (en) * | 2018-05-21 | 2019-11-28 | Telefonaktiebolaget Lm Ericsson (Publ) | Ims-based streaming framework |
CN112230947A (en) * | 2019-06-28 | 2021-01-15 | 中科方德软件有限公司 | Upgrading method and upgrading system of operating system |
Non-Patent Citations (1)
Title |
---|
"怎样重装计算机系统软件,电脑重装系统软件怎么样保留";林书曼;《CSDN,https://blog.csdn.net/weixin_42487788/article/details/118919703》;20210719;第1-2页 * |
Also Published As
Publication number | Publication date |
---|---|
CN114995842A (en) | 2022-09-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9942690B2 (en) | Method and device for information push | |
CN105338409B (en) | Network video preloading method and device | |
US20240192986A1 (en) | Application handoff method and apparatus | |
US10268344B2 (en) | Method and system for providing a content based on preferences | |
CN107133352B (en) | Photo display method and device | |
CN105095025B (en) | Restore the method and device of deleted document in ext file system | |
CN106095318A (en) | Application program open method and device | |
CN104462296B (en) | File management method and device and terminal | |
CN105426386A (en) | File synchronization method and apparatus, and terminal device | |
CN105094904A (en) | Application program installation method and device | |
CN107632835B (en) | Application installation method and device | |
CN112784262A (en) | Data access method, device, terminal and storage medium | |
CN107506496B (en) | Defragmentation method, defragmentation device and computer-readable storage medium | |
CN114995842B (en) | Method and device for installing operating system and readable storage medium | |
CN115098177B (en) | Display card drive switching method and device and readable storage medium | |
CN115658135A (en) | Code analysis processing method and device and readable storage medium | |
CN114528037A (en) | Application starting method and device, electronic equipment and storage medium | |
CN107360315B (en) | Information display method and device | |
CN113946346B (en) | Data processing method and device, electronic equipment and storage medium | |
CN105488131B (en) | File opening method and device | |
CN112445451A (en) | Music playing method and device and electronic equipment | |
CN113934452B (en) | Data processing method and device, electronic equipment and storage medium | |
CN117573234B (en) | Software package uninstallation management method and device, electronic equipment and storage medium | |
KR101300052B1 (en) | Method for searching image and recording-medium recorded program thereof | |
CN115065677B (en) | Media resource acquisition method, device, electronic equipment, storage medium and product |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |