Ubuntu can be removed in three ways depending on how it was installed
If Ubuntu is the only operating system on your computer, you will need to replace it with another OS or wipe the drive entirely. If Ubuntu shares the computer with Windows or macOS, you can remove just the Ubuntu partition and reclaim that disk space. If Ubuntu is running inside a virtual machine (a software container on top of another OS), you simply delete the virtual machine files.
The method you use depends on your setup. The steps are different for each, and choosing the wrong one can leave your computer unbootable or cause data loss. This guide walks through how to identify your situation and what to do in each case.
Key Takeaways
- If Ubuntu is the only OS on your drive, you must install a replacement operating system before deleting Ubuntu, or the computer will not start.
- If Ubuntu shares the drive with Windows or macOS, you can remove just the Ubuntu partition using your existing OS's disk management tools without touching the rest of the drive.
- If Ubuntu runs in VirtualBox, VMware, or another virtual machine program, you delete the virtual machine folder from your main operating system's file manager.
- Removing a partition erases all files in that partition permanently, so back up anything you need before starting.
Identify how Ubuntu is installed on your computer
Before you delete anything, you need to know whether Ubuntu is the only operating system, whether it shares the drive with another OS, or whether it is running as a virtual machine. Each situation requires a different approach.
If you boot your computer and see a menu with options like "Ubuntu" and "Windows" or "macOS", Ubuntu is installed alongside another OS on the same drive. If you boot and go straight into Ubuntu with no menu, Ubuntu is likely the only OS. If you opened a program like VirtualBox or VMware and launched Ubuntu from inside that program, it is a virtual machine.
You can also check by opening Ubuntu and running lsblk in the terminal (press Ctrl+Alt+T to open it, then type lsblk and press Enter). This shows all drives and partitions. If you see multiple partitions with different names — for example, one labeled "Windows" or "macOS" and one labeled "Ubuntu" — they share the same drive.
Remove Ubuntu when it is the only operating system
If Ubuntu is the only OS on your computer, you cannot simply delete it and leave the drive blank. Your computer needs an operating system to start. You must install a replacement OS first — Windows, macOS, or another Linux distribution — before removing Ubuntu.
To do this, you will need an installation disk or USB drive for the OS you want to install. Download the installer from the official source (Microsoft for Windows, Apple for macOS), create a bootable USB using a tool like Rufus or Etcher, and boot from that USB. Follow the installer's instructions and choose to erase the entire disk when prompted. This will overwrite Ubuntu completely and install your chosen OS in its place.
If you want to erase the drive without installing anything, you can use a tool like DBAN (Darik's Boot Nuke) or the secure erase feature built into your computer's firmware. However, this leaves you with a computer that will not start, so you would still need to install an OS afterward.
Remove Ubuntu when it shares the drive with Windows
If Ubuntu and Windows are both on the same drive, you can remove Ubuntu and reclaim its space without touching Windows. You will use Windows' built-in Disk Management tool to delete the Ubuntu partition.
First, restart your computer and boot into Windows (not Ubuntu). Open Disk Management by right-clicking the Start menu and selecting "Disk Management", or by pressing Windows Key + X and choosing it from the menu. You will see a list of all partitions on your drive. Look for partitions labeled with Linux names like "ext4" or "swap" — these are Ubuntu's partitions. Right-click each Ubuntu partition and select "Delete Volume". Windows will ask you to confirm; click "Yes".
After deleting all Ubuntu partitions, you may see unallocated space on the drive. Right-click the Windows partition and select "Extend Volume" to grow it into that space, or leave it unallocated if you plan to install something else later. Restart your computer. Ubuntu will no longer appear in the boot menu, and Windows will start automatically.
Remove Ubuntu when it shares the drive with macOS
If Ubuntu and macOS are both on the same drive, use macOS's Disk Utility to remove the Ubuntu partition. Restart your computer and boot into macOS (not Ubuntu).
Open Disk Utility (search for it in Spotlight by pressing Command+Space, typing "Disk Utility", and pressing Enter). In the left sidebar, select your main drive — usually called "Macintosh HD" or similar. Click the "Partition" button at the top. You will see a visual map of all partitions on the drive. Click the Ubuntu partition (it will be labeled with a Linux name or "Linux Filesystem") and click the minus button below the partition list. Disk Utility will ask you to confirm; click "Remove". The space will be added back to your macOS partition automatically.
Click "Apply" to save the changes. Your computer will restart. Ubuntu will no longer appear in the startup menu, and macOS will boot normally. If you do not see Ubuntu in the startup menu after restarting, restart again and hold the Option key while the computer starts to see all available boot options.
Remove Ubuntu from a virtual machine
If Ubuntu is running inside VirtualBox, VMware, Hyper-V, or another virtual machine program, deletion is straightforward: you simply delete the virtual machine and its files from your main operating system.
Open your virtual machine program and right-click the Ubuntu virtual machine in the list. Select "Remove" or "Delete". The program will ask whether you want to delete the files or just remove the machine from the list. Choose "Delete Files" to remove everything. This will delete the virtual hard drive file (usually several gigabytes) and all other files associated with that virtual machine.
If you cannot find the delete option in your program, you can manually delete the virtual machine folder. Virtual machines are usually stored in your user folder under a path like ~/VirtualBox VMs/ (for VirtualBox) or ~/Documents/Virtual Machines/ (for VMware). Find the folder named after your Ubuntu machine, right-click it, and select "Delete" or "Move to Trash". Empty your trash afterward to free up the space.
What to do if Ubuntu will not boot after deletion
If you deleted Ubuntu from a dual-boot system and your computer no longer starts, the boot loader (the program that shows you the menu of operating systems) may be damaged. This is fixable.
Boot from a Windows or macOS installation disk or USB drive. On Windows, choose "Repair your computer" during setup. On macOS, hold Command+R while starting to enter Recovery Mode. Both have built-in tools to repair the boot loader. Follow the on-screen instructions to rebuild it. Your computer should then start normally into Windows or macOS without showing an Ubuntu option.
Frequently Asked Questions
Will deleting Ubuntu erase my files on Windows or macOS?
No, if you delete only the Ubuntu partition and leave the Windows or macOS partition untouched, your files on that OS will remain. However, any files you saved inside Ubuntu will be permanently deleted along with the Ubuntu partition. Back up anything you need before starting.
Can I undo a partition deletion?
Partition deletion is permanent and cannot be undone through normal means. Some data recovery tools may recover files if the partition was deleted recently and the space has not been overwritten, but this is not reliable. Always back up important files before deleting any partition.
What if I do not see Ubuntu in the boot menu after deleting it?
This is normal. The boot menu only shows operating systems that still exist on the drive. If Ubuntu is gone, it will not appear. If you see a blank screen or error message instead of your expected OS, restart and hold the boot menu key (usually F12, Esc, or Del depending on your computer) to manually select which drive to boot from.
How much disk space will I get back after removing Ubuntu?
You will get back the full size of the Ubuntu partition. If you are unsure how large it is, open Disk Management (Windows) or Disk Utility (macOS) before deletion to see the partition size. Most Ubuntu installations take 10 to 50 gigabytes depending on how many programs and files you added.
Do I need to do anything special if Ubuntu is encrypted?
If you encrypted your Ubuntu partition during installation, you can still delete it the same way — the encryption does not prevent deletion. You will not need a password to delete an encrypted partition, only to access its files. Simply delete the partition as described for your setup.