Uninstall linux from windows

The steps for uninstalling Linux Mint from a Windows dual boot setup are the same for any other Linux distro, be it Ubuntu, Debian, Fedora, Arch, etc.

1. Boot into Windows.

2. Open Disk Management:

  • Press Windows + X to open the Power User Menu.
  • Click on Disk Management.

3. Identify the Linux partition:

  • Look for a partition that is formatted with Healthy (Primary Partition) because it is not showing as ext4 (Linux filesystem).
Disk Management window in Windows

Disk Management

4. Delete the Linux partition:

  • Right-click on the Linux partition and select Delete Volume.

5. Remove the Linux boot entry:

  • Open Command Prompt as Administrator.
  • Run the following command to show the boot configuration details:
Firmware enumeration command output

Firmware Enumeration
  • Identify the Linux boot entry using its identifier.
  • Delete the Linux boot entry by running:
    bcdedit /delete {identifier}
    

6. Open Diskpart:

  • Run the following command to open Diskpart:
Diskpart window showing volume selection

Diskpart
  • Select the volume formatted in FAT32 with the info system. In my system, it is Volume 1. Replace 1 with your volume number:

  • Assign a drive letter (e.g., M) to the selected volume:

  • Exit Diskpart:

7. Navigate to the assigned volume:

  • Run the following commands to navigate EFI folder:
EFI directory contents

EFI Directory

8. Delete the Ubuntu Folder:

rd ubuntu /s
ubuntu, Are you sure (Y/N)? Y
Command to delete Ubuntu folder

Delete Ubuntu

Reboot your system and enjoy Windows or try another Linux distro.

This article describes the steps to uninstall or delete a Ubuntu Linux distribution on Windows 11 with WSL.

Windows Subsystem for Linux lets developers run a GNU/Linux environment directly in Windows without setting up a virtual machine or dual-boot, including most command-line tools, utilities, and applications.

If you no longer want to run a Ubuntu Linux distribution within your Windows WSL environment, Windows allows you to remove it in multiple ways.

Ubuntu Linux and other Linux distributions are available through the Microsoft Store, which is considered an application. Since they are applications, you can use the Windows Settings app, or the Command Prompts to uninstall these distributions.

Below is how to uninstall Ubuntu Linux on Windows with WSL.

How to uninstall Ubuntu Linux on Windows WSL

As described above, if you no longer want to run a Ubuntu Linux distribution within your Windows WSL environment, Windows allows you to remove it in multiple ways.

Below are some ways to uninstall the Ubuntu Linux distribution on Windows 11 WSL.

Uninstall Ubuntu Linux on Windows WSL via the Settings app

Users can remove or uninstall a Ubuntu Linux from the Windows WSL environment via the Settings app.

Since Linux distributions are installed through the Microsoft Store, they are considered apps and can be removed or uninstalled like any app.

First, open the Windows Settings app. You can access the Settings app by clicking on the Start button and selecting Settings.

windows 11 new settings button

windows 11 new settings button

When the Settings app opens, go to Apps -> Installed apps (Apps & features). Find the Ubuntu Linux app on the list of installed apps, click on the menu option (three dots on the right), and select Uninstall.

uninstall ubuntu from wsl windows 11

Uninstall Ubuntu from west windows 11

Uninstall Ubuntu Linux on Windows WSL via Command Prompt

Another way one can remove or uninstall Ubuntu Linux from the Windows WSL environment is via the command prompt.

First, open the Command Prompt or Windows PowerShell as administrator.

To list all installed apps, run the commands below.

winget list

This will list all installed packages. From the list, identify the Ubuntu Linux package.

Name                                                         Id                                                  Version             Available Source
-----------------------------------------------------------------------------------------------------------------------------------------------------
Visual Studio Community 2022                                 Microsoft.VisualStudio.2022.Community               17.4.0              17.4.1    winget
HP Smart                                                     AD2F1837.HPPrinterControl_v10z8vjag6ke6             140.1.307.0
Ubuntu on Windows                                            Canonical.Ubuntu                                    2004.2022.1.0                 winget
Microsoft Edge                                               Microsoft.Edge                                      107.0.1418.42                 winget
Microsoft Edge Update                                        Microsoft Edge Update                               1.3.171.37
Microsoft Edge WebView2 Runtime                              Microsoft.EdgeWebView2Runtime                       107.0.1418.42                 winget
Cortana                                                      Microsoft.549981C3F5F10_8wekyb3d8bbwe               4.2204.13303.0
App Installer                                                Microsoft.DesktopAppInstaller_8wekyb3d8bbwe         1.18.2691.0
Xbox                                                         Microsoft.GamingApp_8wekyb3d8bbwe                   2211.1001.24.0
Get Help                                                     Microsoft.GetHelp_8wekyb3d8bbwe                     10.2208.2551.0
Microsoft Tips                                               Microsoft.Getstarted_8wekyb3d8bbwe                  10.2207.2.0
HEIF Image Extensions                                        Microsoft.HEIFImageExtension_8wekyb3d8bbwe          1.0.43012.0

Under the package ID column, location the name of the package. Use the command format below to uninstall the package.

winget uninstall --id "UbuntuPackageName"

For example, run the commands below to uninstall Ubuntu.

winget uninstall --id Canonical.Ubuntu

Uninstall Ubuntu Linux from Windows WSL via wsl.exe

If the Ubuntu Linux distribution was imported, you might not find it under the installed apps section. You may have to run the commands below to uninstall.

Open the Command Prompt or Windows PowerShell as administrator.

Then run the commands below to list the Ubuntu Linux distros.

wsl --list

Run the command format below.

wsl --unregister Ubuntu-linux-name

For example, run the commands to uninstall Ubuntu.

wsl --unregister Ubuntu

That should do it!

Conclusion:

  • Multiple Methods: You can uninstall Ubuntu Linux on Windows WSL via the Settings app, Command Prompt, or WSL utility.
  • Ease of Use: Whether you prefer using a graphical interface or command line, Windows provides intuitive methods for uninstalling Ubuntu Linux distributions.
  • Flexibility: Users can choose their preferred approach for removing Ubuntu Linux from the Windows WSL environment.

This article has covered the various options to completely uninstall or delete a Ubuntu Linux distribution from Windows 11 with WSL.

Warp Terminal

Trust me, installing Ubuntu in dual boot with Windows is not that difficult a task. Similarly, removing Ubuntu from dual boot is also not that complicated.

In both cases, you need to take a bit of precautions with disk partitions. Having a Windows recovery and proper backups always helps.

In this tutorial, I am going to show you the steps for uninstalling Ubuntu from Windows dual boot. The steps should be equally valid for any other Linux distribution be it Linux Mint, Debian, Fedora, Arch etc.

Uninstall Ubuntu safely from Windows dual boot mode

The process is composed of two parts:

  • Change the boot order in UEFI settings and give priority to Windows Boot Manager. You may also delete Grub entry from UEFI setting, if your system gives you this option. If that doesn’t work then you’ll have to repair boot with a bootable Windows disk.
  • Deleting the Ubuntu partition from Windows.

As a last resort, you need to have a bootable Windows disk or recovery disk so that you can use it to repair the boot after removing Ubuntu (if needed).

Part 1: Run a sanity check and make Windows the default boot manager

I want you to have as few troubles as possible. Hence I recommend changing the boot setting and making Windows boot manager as the default option to boot.

Let me explain a bit here. When you install Ubuntu or some other Linux, it adds Grub bootloader to your boot settings and makes it the default.

So, now your system has two boot loaders or boot manager (whatever you want to call it). Grub gives you option to boot into Ubuntu or Windows.

Dual Boot Grub Screen

Windows boot manager lets you boot into Windows directly. And this is what you are going to use here.

Step 1: Access UEFI boot settings

Before you go on and delete the Linux partition, it will be a wise move to check if you can make Windows boot manager as the default boot option. This way, when you remove Linux, your boot process won’t be disturbed.

Access the UEFI settings from Windows. Search for UEFI and go to Change advanced startup options:

Accessing UEFI Settings Windows

Click on Restart now:

Access Uefi Settings Windows

On the blue screen next, select Troubleshoot:

windows uefi settings

Select Advanced Options next:

advanced uefi settings

On the next screen, select UEFI Firmware Settings:

uefi firmware settings

Hit restart button on the next screen:

restart boot settings uefi

Step 2: Move Windows Boot Manager up the boot order

Now, your system will boot into UEFI settings. Now, the next screen will look different for different systems and manufacturers. You have to look for boot tab here.

On my Acer predator, it looks like the image below. Here, use arrow keys to select Windows Boot Manager and press F5 to move it up the order. Press F10 to save and exit.

change boot order

Now, your system should boot straight into Windows. To verify, restart your system a couple of times and see if the system boots into Windows without showing the grub screen of Linux.

🚧

This is crucial. You should be able to boot into Windows by default without grub. Ensure that otherwise you’ll end up with boot issues.

If that happens, you are good to go with the next step: delete the Linux partition and reclaim your disk space.

Part 2: Deleting Linux partition on Windows

Let’s see how to delete the Linux partition and extend your Windows disk with available free space afterwards.

Step 1: Go to disk management

Log into Windows. Press Windows+R and type diskmgmt.msc into the dialog box. This will open the Windows disk management tool.

Disk Management Windows

Step 2: Identify Linux partition

Since you installed Linux, it’ll be easy to recognize the Linux partition by size.

💡

Another hint for identifying the Linux partition is to look for those that don’t have a file system and drive number. Windows partitions are labeled with a drive number, such as C, D, E, etc., and usually use the NTFS or FAT file system.

As you can see, I have three Linux partitions here as I created root, swap and home separately when I installed Ubuntu.

Delete Linux Partition

Step 3: Delete the Linux partition

Select the Linux partition(s), right-click on them and opt for the Delete Volume option.

Uninstall_Linux_From_WIndows_Dual_Boot_1

It will throw you a warning – just select Yes here.

Uninstall_Linux_From_WIndows_Dual_Boot_2

Step 4: Extend Windows partition

The deleted partition(s) will now be available as a chunk of free space. You can either extend the existing volume or create a new Windows partition from it.

I would suggest that you create a new drive (or volume or partition, whatever you want to call it) as this will be easier if you decide to dual-boot Linux with Windows again.

Uninstall_Linux_From_WIndows_Dual_Boot_3

You moved Windows boot manager up the boot order and now the system boots from it. Even though you removed Ubuntu’s partition, the boot menu will still show it. That’s because the boot entries are stored on the EFI system partition (ESP).

You may leave it as it is and it won’t be an issue. But if you really want, you can get rid of the Ubuntu entry from the boot menu with a little effort.

Delete Linux Entry from Boot Menu from Windows After Removing Linux

Removed the Linux partition from dual boot set up but Linux entry is still there in the UEFI boot settings? H ere’s how to get rid of it if you really want it.

It’s FOSSAbhishek Prakash

Troubleshooting tips to fix the Windows boot loader

After deleting the Linux partition, if your system boots into a broken Grub screen which shows a message like Grub rescue error, you need to use a Windows recovery disk and fix the Windows bootloader.

Put in the Windows installation disk and restart your computer. Press F10 or F12 at boot time to go into BIOS/UEFI and choose to boot from removable disk.

Booting from Windows installation disk

Choose to repair your computer:

Repair windows boot loader

Go for the Troubleshoot option here:

troubleshoot windows and linux dual boot

On the troubleshooting page, choose Advanced options:

Uninstall_Linux_Windows_Dualboot_4

Look for the command prompt option in here:

Uninstall_Linux_Windows_Dualboot_6

In the command line, type the following command to fix the Windows boot loader:

bootrec.exe /fixmbr

Normally, it works instantly. You don’t even have to wait for it.

Uninstall_Linux_Windows_Dualboot_5

Once it’s done, restart your computer and boot normally from the hard disk. You should be able to boot into Windows. If you still see a Grub rescue error, try the steps below.

If the trick in step 6 didn’t work

If the command in step 6 didn’t work, try Automatic repair from the advanced troubleshooting options.

automatic repair windows troubleshoot

It will take some time to find the issue and then repair it.

Automatic repair Windows Linux dual boot

Now if you reboot, you should go into Windows normally without seeing any Grub rescue error thingy.

Conclusion

I hope this guide helped you safely remove Ubuntu from Windows dual boot. Feel free to ask any questions or make a suggestion.

Linux are great operating systems, and for beginners, installing Linux in a dual-boot configuration
with Windows is the simplest way to get it up and running without sacrificing productivity during
the learning phase. Nowadays, you can easily install any beginner-friendly Linux distribution in a
matter of minutes, and there are numerous guides available that explain how to do so.

However, there are times when you may want to uninstall it. Maybe you messed something up and can’t fix
it, or your current distro isn’t to your liking, and you want to change it, or something else. There
could be several reasons for this, but uninstalling Linux isn’t as simple as installing it, especially
if it was installed in a dual-boot configuration with Windows, and it’s even more difficult if your PC
has a UEFI Firmware (which it most likely does if it was manufactured after 2008).

You might wonder if there aren’t uninstallation guides available, just like there are installation guides.
Well yes, there are guides that explain how to uninstall Linux. Most of them, however, are for PCs with
Legacy (BIOS) Firmware and will not work on a PC with UEFI Firmware. Now, I’m not saying those guides
are completely incorrect; they just don’t work in our situation.

That is why I have created this guide, which is aimed specifically at PCs with UEFI Firmware, to
assist you in uninstalling your Linux distro.

Things to Consider

Before we get stared, here’s a little heads-up for you:

  • As I have stated earlier this guide is aimed at PCs with UEFI Firmware. Therefore, it will not work
    on a PC with Legacy Firmware. If you don’t know your PC’s Firmware type, you can check that in
    System Information, under System Summary > BIOS Mode.

Image showing System Information

  • We’ll be deleting some partitions from your Disk. So, be careful while doing this, otherwise you may
    end up deleting a partition you care about.
  • Please do not delete Linux partitions before removing the GRUB2 Boot-Loader from your PC’s
    EFI System Partition. As it will make your PC unable to boot.

GRUB2 Bootloader without any OS

Part 1: Removing the Boot-Loader

We’ll begin by removing the GRUB2 Boot-Loader from your PC’s EFI System Partition. Since
removing Linux partitions isn’t enough to completely uninstall a Linux distro because the
GRUB2 Boot-Loader will prevent your PC from booting if it isn’t removed first.

So, to start we’ll remove the GRUB2 Boot-Loader. First, launch Command Prompt or PowerShell,
whichever you prefer, as administrator by performing a right-click on the Start Menu and choosing
Command Prompt (Admin) or Windows PowerShell (Admin), whichever is present on that menu.

Now, run the following command to start DiskPart utility:

diskpart

Then, this one to show a list of all Disks connected to your PC:

list disk

If you have multiple Disks, then you’ll need to identify your System Disk (Disk on which Windows
and Linux are installed). If you don’t know which one is your System Disk, you can check that by going
to Disk Management.

Image showing list disk command in DiskPart

Now, run this command to select your System Disk (replace 0 with your Disk number):

select disk 0

After that, run this command to list all partitions on your Disk:

list partition

Image showing list partition command in DiskPart

From this list, you’ll need to identify your EFI System Partition (It’s Type will be mentioned as
System, and it will be around 100 MB in size). Now, run this command to select your EFI
System Partition (replace 1 with your Partition’s number):

select partition 1

Then, run the following command to give a Drive Letter to your EFI System Partition. By doing this
we’ll be able to modify files inside it. You can use any letter you want as long as it’s not already
in use.

assign letter=x

After that, run this command to leave DiskPart:

exit

Image showing select and assign commands in DiskPart

Now, we need to enter the Partition we just mounted. To do that just type the Drive Letter you chose
while mounting it along with a colon(:) sign.

x:

Now to see the contents of this Partition type:

dir

Image showing directory of drive X

Here you will see a folder named EFI, we need to enter it. To do that just type:

cd efi

Now to see the contents of this folder, again type:

dir

Image showing directory of EFI folder

Here you will see a folder with the name of your Linux distro (Ubuntu, Debian, Fedora, etc.). We need
to delete this folder. To do that run the following command replacing the folder-name with your distro,
exactly the way it is shown in the list. This command is a little different on Command Prompt and
PowerShell, so use the one according to the shell you are using.

Command Prompt :

rd folder-name /s

PowerShell :

rd folder-name -r

Image showing remove directory command in Command Prompt

Now type DIR again to make sure its deleted and then close the Command Prompt:

dir

Image showing directory of EFI folder

Part 2: Deleting the Partitions

The GRUB2 Boot-Loader is now gone. Deleting all Linux partitions is what we will do next. First,
launch Disk Management by performing a right-click on the Start Menu and choosing Disk Management.

Then, identify your Linux partitions, depending on your configuration you may have a single Linux
partition or may have multiples of them. Look for partitions that don’t have a Drive Letter,
like (C:), (D:), etc. and don’t have a File System mentioned, like NTFS or FAT32. But, do not delete any
partitions with labels like EFI, System, OEM, Boot, Recovery or something similar.

Image showing Linux Partitions in Disk Management

Now to Delete them, Right-click on them one-by-one and select Delete Volume. Select Yes when prompted.

Image showing Linux Partitions being Deleted in Disk Management

Image showing Linux Partitions being Deleted in Disk Management

After that, Right-click on the partition very next (on left-hand side) to the deleted partitions
and click Extend Volume. Doing this will open a wizard that will help you in merging the
free space obtained from the deleted partitions to the adjacent partition.

Image showing a Partition being Extended in Disk Management

Image showing a Partition being Extended in Disk Management

And Done! You have successfully uninstalled your Linux distro from your PC. I hope this article was
helpful and saved you some hassle. Thanks For Reading!

Last updated on December 17, 2024

What do you do if you have installed Ubuntu on your PC alongside Windows but don’t want to use Linux anymore? You now have a Linux partition on your hard drive that is taking up space you want to use for your Windows folders and files.

This article will show you how to safely uninstall Ubuntu in Windows 10 dual boot without losing data or applications.

The first part of this process is to remove the Linux operating system. Keep in mind that this will also remove all your Ubuntu data and system files. Be sure to save anything you don’t want to delete somewhere else. The second part of the process is to change the Windows boot loader.

How to Uninstall Ubuntu in a Windows 10 Dual-Boot System image 1

Before making any changes to your computer, you always want to back up your files. Even if you have only been using Linux for a short period, there will most likely be data you want to save.

Also, you want to back up all the critical data from your Windows partition. Use an external hard drive, cloud storage, or DVDs so that you don’t lose any data.

Make sure you have a USB or DVD of Windows. You can download a copy of Windows 10 from Microsoft.

Delete The Linux Partition In Windows

  • Start by logging into Windows. Hold down the Windows key + R and type diskmgmt.msc to open the Windows disk management tool.
How to Uninstall Ubuntu in a Windows 10 Dual-Boot System image 2

Linux partitions are differentiated from Windows because they don’t have a drive number and file system.

How to Uninstall Ubuntu in a Windows 10 Dual-Boot System image 3

Windows partitions can be identified by the drive label such as C, D, and E. They are also usually FAT or NTFS files.

  • To delete the Linux partitions, right-click on each one and choose Delete Volume.
  • A warning will pop-up letting you know that you are trying to delete a partition that wasn’t created by Windows. Then, you will be asked if you want to delete it. Select Yes.

Deleting the partitions will free up space on your drive.

How to Uninstall Ubuntu in a Windows 10 Dual-Boot System image 4

  • If you have other Linux partitions, delete them in the same manner. Right-click on Free space and select Delete Partition. Then click Yes when the dialogue box pops up.
  • Now the free space is changed to unallocated space. To expand your Windows partition to occupy the free space, right-click on the Unallocated space and choose Extend Volume from the dropdown options.
  • The Extend Volume Wizard will then open. Click Next > Next > Finish.
How to Uninstall Ubuntu in a Windows 10 Dual-Boot System image 5

After the process is complete, you will see only one volume meaning you have claimed all your disk space back to Windows.

Once you remove Linux partitions from your computer, the boot loader for Ubuntu is still there and needs to be removed as well. There are several ways to do this.

Remove the Grub Bootloader

  1. Go to the Windows Start menu and click on the power icon. Then press and hold down the Shift key and select Restart.
  2. Continue holding down the shift key until you see the Choose an option screen.
  3. Select the Troubleshoot option > Advanced options > Command Prompt. Choose your user account from the Command Prompt options and enter your password.
  4. This will open a command-line terminal. Type bootrec /fixmbr and hit Enter. See the message that the operation has completed successfully.
  5. Next type bootrec /fixboot > Enter. See the same message that the operation has completed successfully. Type another command bootrec /scanos > Enter. This command will scan all your disks to see if there are any instances of the Windows OS. The time it takes to complete depends upon your system specifications and the size and number of disks you have installed. When the scan is complete, you will see the Windows installations you have on your disk. 
  6. To make Windows your primary boot OS, type the command bootrec /rebuildbcd > Enter.
  7. If you have multiple Windows installations, you will see a list of all of them and where they are stored on your drive. Type A > Enter to complete the process. 
  8. To close the terminal, type exit > Enter. You have now successfully removed everything related to Ubuntu. Your PC will now boot directly to Windows.

Overwrite the Linux Boot Loader with Windows Boot Loader

  • To overwrite the Linux boot loader with the Windows boot loader, insert the USB Windows Installer you downloaded above into your computer and restart it. 
  • After booting your system from the USB recovery disk, click on repair your computer.
  • From the next screen, choose the Troubleshoot option.  
How to Uninstall Ubuntu in a Windows 10 Dual-Boot System image 6

  • Choose Command Prompt from the next Advanced options screen.
How to Uninstall Ubuntu in a Windows 10 Dual-Boot System image 7

  • From the command prompt window, enter bootrec.exe /fixmbr. This will fix the Windows boot loader.
  • Restarting your computer now will boot it from the hard drive. Windows will now work as it should, and Linux will no longer be on your system.

What if You Don’t Have a Windows Installation CD or USB?

You can still uninstall Ubuntu dual boot from Windows 10 or Ubuntu as explained below.

  • From Windows 10, run the command prompt as Administrator.
How to Uninstall Ubuntu in a Windows 10 Dual-Boot System image 8

  • Run the command below to set the correct EFI executable as the default boot entry:

bcdedit /set “{bootmgr}” path \efi\microsoft\boot\bootmgfw.efi

  • To see if the above command worked, reboot your computer. If successful, it should boot directly to Windows.
  • To delete the partitions, follow the steps above, starting with typing diskmgmt.msc (the Delete the Linux Partition in Windows section)

Change Boot Order Using UEFI

  • You can change the UEFI boot order directly from the firmware (BIOS) settings. To access the BIOS from Windows 10, click on the Start button > Settings > Updates & security.
How to Uninstall Ubuntu in a Windows 10 Dual-Boot System image 9

  • On the left-hand column, click on Recovery. Under Advanced startup, click Restart now.
How to Uninstall Ubuntu in a Windows 10 Dual-Boot System image 10

  • Choose Troubleshoot > Advanced options > UEFI Firmware Settings. On the UEFI Firmware Settings screen, click Restart. Your computer will then restart and load into the BIOS.
How to Uninstall Ubuntu in a Windows 10 Dual-Boot System image 11

Uninstalling Ubuntu from Windows 10 dual boot is not difficult. You can follow one of the methods above to do so without losing any data.

Related Posts

  • What Version of Ubuntu Do I Have?
  • How to Uninstall Dropbox on Mac, Windows, and Linux
  • How to Open 7Z Files in Windows, Mac, and Linux
  • What Is a TAR.GZ File and How to Open It
  • How to Type Letters with Accents on Windows, Mac and Linux

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Как полностью скрыть папку в windows 10
  • Как отредактировать загрузочную запись в windows 10
  • Как включить dhcp на компьютере windows 10
  • Зачем выпустили windows 11
  • Anaconda python jupiter notebook windows