Skip to content

How to uninstall Ubuntu

Rate this post

How to uninstall Ubuntu: After trying Ubuntu for a few weeks, did you realize that this operating system is not for you? I must admit I’m sorry: I bet that by going deeper into the Linux world, you would have discovered many interesting things. Anyway, I respect your choice and I’m here to help you out.

If you’ve decided to say goodbye (or, maybe, goodbye) to Ubuntu, now you’re definitely looking for a way to delete it from your computer. The thing, of course, is feasible but, I want to clarify it from the outset, the procedure to be implemented essentially depends on whether you have previously installed it in dual boot Linux or as the only operating system. In all cases, don’t worry, I will explain to you how to uninstall Ubuntu in the most “painless” way possible.

Then? Can I know what are you still doing there impaled? Position yourself comfortably in front of your computer, take a few minutes of free time just for yourself and start to concentrate on reading my guide dedicated to the topic. I am sure that, in the end, you will be able to say that you are happy and satisfied with what you learned as well as, of course, that you have finally succeeded in your intent. How about we bet?

Preliminary operations

PC with Ubuntu

Before getting to the heart of the tutorial and finding out how to uninstall Ubuntu , there are some preliminary steps that I suggest you do to make sure that everything goes the right way.

First of all, considering that with the removal of Ubuntu the data saved on the partition hosting this operating system will also be removed (unless you have created a separate partition, only for the data), I recommend you to make a backup .

To make a backup of your data, all you have to do is get an external hard disk (if you don’t have one yet, you can read my purchase guide ), connect it to your computer and transfer your personal files to it, using the  Ubuntu file manager , which you can access by clicking on the File icon (the one with the drawer ) located on the dock bar , or by using the “standard” utility used for the purpose in question, which you can call up and configure by clicking on the gear icon  located at the top right of the screen, selecting the System Settings itemfrom the menu that appears and clicking on the Backup item , in the window displayed on the desktop.

If you have installed Ubuntu as the only operating system and not on a dedicated partition on your computer, I also suggest that you obtain the diskette or image file for Windows installation in advance , which you can use to install the Microsoft operating system again.

In this regard, I point out that you can extrapolate the ISO image of the Windows CD / DVD using a PC equipped with an optical drive or with an external burner , as I indicated in my guide on how to create ISO files , and then transfer it to a stick USB to use to install the OS on your computer, as I indicated in my post on how to create a bootable USB stick .

Another solution that you can consider is to use the appropriate tools for Windows 10Windows 8.1  and  Windows 7  to create the ISO images of the operating system and media, which can be downloaded directly from the Microsoft website.

How to uninstall Ubuntu in dual boot

You had installed Ubuntu in dual boot with Windows, but now you have second thoughts and would you like to get rid of the famous Linux distro? As I said at the beginning of the post, it can be done.

Below, you will find out how to proceed. I anticipate, however, that the procedure to be followed varies depending on whether yours is a PC with BIOS or UEFI : for further details, continue reading.

PC with BIOS

Windows 7 disk management

If what you are using is a PC with BIOS , then an old-fashioned computer with Windows 7 or earlier installed , in order to uninstall Ubuntu from the partition that hosts it, the first step you need to do is turn on the PC, start Windows and open the Disk Management utility included in the Microsoft operating system.

So, click on the Start button (the one with the Windows flag ) that you find in the bottom left part of the taskbar , type the term  “partitions” in the search field that appears on the screen and select the result Create and format the hard disk partitions among those available in the Start menu .

In the window that will open, right click on the box relating to the disk partition on which Ubuntu is installed , select the Delete volume item from the menu that appears and click the Yes button  , to delete the partition with all its contents.

Afterwards, repeat the operation with the Ubuntu swap partition and a box relating to the free space available on the disk should appear. To transform this free space into unallocated space to distribute on the other partitions of the disk (e.g. that of Windows), right-click on it and select the Delete partition item from the contextual menu.

At this point, you just have to click with the right mouse button on the box relating to the partition you want to extend (eg C 🙂 and select the Extend volume item from the menu that opens. In the further window that you see on the screen, click on the Next button  twice in a row, then on the one with the word  Finish and you’re done.

Now that you have finally managed to uninstall Ubuntu from your PC, there is another fundamental step that you need to worry about taking: restore the Windows boot menu , replacing the Linux distro files that until now had allowed you to run the boot of both operating systems.

There are two ways to do this: the first, the simplest one, is to resort to the use of EasyBCD , a free application (for personal use only, otherwise the user license must be purchased at a cost of 29.95 $) which allows you to manage, customize and repair your computer’s boot settings. Otherwise, if you have a Windows installation media , you can start it and run the restore procedure from the command line.

If you have chosen to use EasyBCD, firstly download the software by connecting to its official website , scrolling the displayed page, identifying the Non-commercial column and clicking on the Register button . Then type your name and e-mail address in the appropriate fields and click on the Download button .

When the download is complete, open the obtained .exe file and, in the window that appears on the desktop, click on the Yes button . Then press the Next and I Agree buttons and conclude the setup by pressing the Next , Install and Finish buttons .

At this point, select Italian from the drop-down menu for choosing the language, click the Go button , to confirm your choice, then click OK and you will finally be shown the main window of the software.

Now, select the item BCD path from the left sidebar, select the option  Install the Windows Vista / 7 bootloader in the MBR  that you find on the right and click on the Write the MBR button , to restore the Windows boot files .


If, on the other hand, you prefer to use a Windows installation medium, connect the latter to the computer, restart the system and boot by pressing any key on the keyboard when the message appears on the screen, press a key to start from the CD-ROM or DVD-ROM . If the message does not appear and / or Windows starts again, change the order of the boot devices by first setting the burner or the USB port, going to intervene on the BIOS settings: I explained everything in detail in my guide on how to set up the BIOS .

In the screen that will subsequently open, click on the  Next , Restore my computer , Next and Command Prompt buttons .

Windows command prompt

Finally, in the Command Prompt window, type the commands  Bootrec.exe / fixboot and Bootrec.exe / fixmbr , press the Enter key on the computer keyboard to give it, and restart the PC, so as to resume using Windows normally .

PC with UEFI

Diskpart Command Prompt Windows 10

If what you are using is a fairly recent PC with Windows 8 or later installed , instead of the BIOS you will find the UEFI  (in a nutshell, a new generation BIOS with graphic interface, mouse support and other important new features in terms of security), which is why you have to proceed in a different way than I indicated a few lines above.

So, firstly call up the Disk Management tool , by clicking on the Start button (the one with the Windows flag ) located at the bottom left of the taskbar , typing the term  “partitions” in the search field displayed on the screen and selecting the result Create and format the hard disk partitions . Then delete the partition dedicated to ubuntu , as I already explained to you in the previous chapter .

After deleting the Ubuntu partition, click again on the Start button , type  “prompt” in the search field, right click on the command prompt link , select Run as administrator from the context menu and click the Yes button , in the window displayed on the desktop, to start the Prompt with administrator privileges.

At this point, type the diskpart command   and press the Enter key on the keyboard to start the Windows disk management tool. Then enter the list disk command , so as to display the list of hard disks present on the computer, and locate the main disk of the PC (eg Disk 0 ). Select, therefore, the latter, giving the select disk X command (where instead of X you have to type the number corresponding to the disk) and give the list part command , to view the list of partitions available on the selected disk.

Now you need to locate the EFI partition : the one in which the data relating to the system boot procedure is kept. Usually, the EFI partition is the smallest one (500 MB or less), but to be sure of its “identity”, you can use the Disk Management tool to check which partition is described as EFI system partition in the boxes located at the bottom .

Once you have identified the correct partition, type the select part X command (where instead of X you have to type the EFI partition number). Next, assign a letter to the partition using the assign letter = x command (where instead of x you can choose any drive letter, excluding those already in use on the PC) and exit diskpart by typing the exit command .

Now the EFI partition is “mounted” in Windows, but to change its contents you need to run File Explorer as administrator. How? Simply by closing it and reopening it from the Command Prompt (which is already running with administrator privileges).

Type, therefore, the commands taskkill / im explorer.exe / f (to close the file explorer ) and explorer.exe (to restart it), then open the file explorer by clicking on the yellow folder icon on the taskbar, select the Computer item  on the left, select the EFI partition and go to the EFI folder contained in the latter.

Now, delete the folder called Ubuntu by  dragging it to the Trash and “unmount” the partition from Windows by giving the select disk x commands (where instead of x you have to type the disk number on which the EFI partition is present), select part x (where in place of x you have to type the number of the EFI partition) and remove letter = x (where in place of x you have to type the letter of the EFI partition) in the Command Prompt.

Unfortunately it is not over yet! To uninstall Ubuntu 100% you must also remove the references to it in the UEFI menu . To do this, you need to start a live version of Ubuntu (from DVD or USB stick), as I explained in my tutorial on how to install Ubuntu , and install the efibootmgr utility from the Terminal using the commands sudo apt-get install efibootmgr and sudo modprobe efivars , followed by pressing the Enter key on the keyboard.

Ubuntu efibootmgr

When the operation is complete, give the command sudo efibootmgr , to view the list of all the items in the UEFI boot menu and locate the one related to ubuntu (e.g. * Boot0005 ubuntu **, which in this case would be item number 5 ). Finally, enter the command sudo efibootmgr -b 5 -B  (where instead of 5 you have to type the number corresponding to the boot entry to be deleted) and the game should be done.

If you are still having trouble booting Windows, try restoring the boot files from the operating system’s recovery menu.

To access it on Windows 10 , click on the Settings icon (the one in the shape of a gear ) in the Start menu , select the items Update and security> Restore and click on the Restart now button , which is found next to the wording Advanced start . Then select the items Troubleshooting> Advanced options> Startup recovery and wait for the procedure to complete.

Windows 10 Startup Repair

To access it on Windows 8 / 8.x , instead, look for PC Settings in the Start Screen , select the relevant result, click on the  Update and restore and Restore items and then on the Restart now button in the displayed screen. Then, even in this case, select the items  Troubleshooting> Advanced options> Startup recovery and wait for the procedure to be completed.

How to uninstall Ubuntu and install Windows

Windows installation on Ubuntu

You didn’t install Ubuntu in dual boot, but as the only operating system on your PC, and now would you like to understand how to remove it by going to install Windows ? I’ll explain right away how to proceed.

The first fundamental step you need to take is to get support for installing Windows, as I explained in the chapter at the beginning of the guide , connect it to your PC with Ubuntu installed and turn on the latter. If the computer is already on, restart it.

When the computer starts , when you see the message appear, press a key to boot from CD-ROM or DVD-ROM , press any key on the keyboard to boot from the diskette or the key. If the writing does not appear and / or Ubuntu starts again, change the order of the boot devices by setting the burner the USB port as primary, proceeding as I indicated in my tutorial on  how to set the BIOS .

Then, follow the wizard to install the version of Windows of your interest by setting the language , format and currency and keyboard layout , by clicking on the Next button and on the Install button .

Windows 7 installation screenshot

Next, type (if required) the product key of your copy of Windows (you can also choose to provide it after installation is complete), put a check in the box to accept the conditions of the license agreement and click again on the Next button .

Now, select the Custom option , click on the partition dedicated to Ubuntu (the one that takes up the most space and that is labeled with the item System) and the item Drive options located at the bottom, then press the Delete link and the OK button to confirm the choice made.

Now, make sure that the newly formatted partition is the selected one, press the Next button and wait for the Windows installation to complete. Then wait for the devices to be configured and follow the initial procedure for setting up Windows to be able to start using the computer immediately. For more details, refer to my guides on how to install Windows 10 , how to install Windows 8 and how to install Windows 7 .

How to uninstall Ubuntu from Windows 10

Disable Ubuntu Bash shell on windows 10

On Windows 10 , starting from the Anniversary Update , it is possible to run native software for Ubuntu without having to actually install the operating system on the computer, using the Linux Bash shell . However, if you are here now and you are reading this passage, it seems clear to me that you are already aware of the thing, that you have enabled the Ubuntu Bash on your PC but that you have now thought about it and would like to understand how to get rid of it. I’m wrong? No, here it is. Then follow the instructions on what to do that you find below.

To succeed in your intent, the first step you need to take is to start the Command Prompt with administrative privileges. So, click on the Start button (the one with the Windows flag ) that you find in the bottom left part of the taskbar , type  “cmd”  in the search field displayed, right click on the relevant result, select the Run item as administrator from the menu that appears and press the Yes button .

At this point, if you want to uninstall the Ubuntu Bash keeping the home and root folder , type the lxrun / uninstall command  , press the Enter key on the keyboard and press the y key to confirm the execution of the operation.

If, on the other hand, you want to remove the Ubuntu Bash by deleting all the files and folders , the command that you must give in the Command Prompt is  lxrun / uninstall / full , always followed by pressing the Enter key on the computer keyboard. Then, confirm the execution of the operation by pressing the y key .

Disable Ubuntu Bash shell on windows 10

If you are interested in completely removing the Linux Bash from your computer, you need to adjust the Windows settings. To do this, click on the Start button , type  “control panel” in the search field and select the relevant result from the list that is shown to you.

In the Control Panel window that you now see on the desktop, click on the item Programs  and / or  Programs and features (depending on the type of display set), then select the link Activate or deactivate Windows features that you find on the left side of the screen .

In the new window that will open at this point, remove the check from the box next to the wording Windows subsystem for Linux and click on the OK button to make sure that the changes made are actually applied to the OS.