A method for configuring an operating system vendor country, applied to an electronic device, wherein the electronic device comprises a processor and a memory, and the memory comprises a basic partition, a first static partition, a second static partition, a dynamic partition, and a user data partition; a process of starting an operating system by the electronic device comprises an initialization step, a first vendor country file and a second vendor country file are stored in the basic partition, and when the electronic device starts the operating system from the first static partition, the first vendor country file is loaded in the initialization step; when the electronic device starts the operating system from the second static partition, the second vendor country file is loaded in the initialization step; current vendor country content of the first vendor country file is a first vendor country, and the electronic device loads data from the basic partition wherein the data loaded from the basic partition are system data that are not used for updating the operating system, the first static partition, and the dynamic partition after being started, so as to start the operating system from the first static partition; and after the operating system is started, the method comprises: obtaining an operating system upgrade package, wherein the operating system upgrade package comprises a third vendor country file, and vendor country content of the third vendor country file is a second vendor country; extracting the third vendor country file; writing the vendor country content of the third vendor country file into the second vendor country file; triggering a first restart of the electronic device from the first static partition; entering, by the electronic device, a recovery mode after the first restart; restoring factory settings of the electronic device in the recovery mode, comprising: deleting a vendor country configuration file stored in the user data partition; and triggering a second restart of the electronic device, wherein the electronic device starts the operating system from the second static partition after the second restart, and an initialization step after the second restart at least comprises: creating the vendor country configuration file in the user data partition, and writing vendor country content of the second vendor country file into the vendor country configuration file, wherein the vendor country file contains a vendor country of the electronic device, wherein the initialization step after the second restart further comprises: determining whether the vendor country configuration file exists in the user data partition, and when the vendor country configuration file does not exist in the user data partition, creating the vendor country configuration file in the user data partition, and writing the vendor country content of the second vendor country file into the vendor country configuration file. obtaining an operating system upgrade package, wherein the operating system upgrade package comprises a third vendor country file, and vendor country content of the third vendor country file is a second vendor country; extracting the third vendor country file; writing the vendor country content of the third vendor country file into the second vendor country file; triggering a first restart of the electronic device from the first static partition; entering, by the electronic device, a recovery mode after the first restart; restoring factory settings of the electronic device in the recovery mode, comprising: deleting a vendor country configuration file stored in the user data partition; and triggering a second restart of the electronic device, wherein the electronic device starts the operating system from the second static partition after the second restart, and an initialization step after the second restart at least comprises: creating the vendor country configuration file in the user data partition, and writing vendor country content of the second vendor country file into the vendor country configuration file, wherein the vendor country file contains a vendor country of the electronic device, wherein the initialization step after the second restart further comprises: determining whether the vendor country configuration file exists in the user data partition, and when the vendor country configuration file does not exist in the user data partition, creating the vendor country configuration file in the user data partition, and writing the vendor country content of the second vendor country file into the vendor country configuration file.