I recently built a computer but I didn't have the budget to buy Windows 8, so I installed Linux Mint 17. Now I have enough money to buy Windows, but I don't know how to completely remove Linux from my hard drive.
Windows 10’s new Ubuntu-based Bash shell doesn’t function like a normal program. To uninstall it or reset its state to get a fresh Linux environment, you’ll need to use a few special commands.
Update: As of the Fall Creators Update, you can now uninstall Ubuntu or any other Linux distribution like a normal application. For example, to uninstall Ubuntu, just right-click the Ubuntu shortcut in your Start menu and click “Uninstall”. To reinstall a Linux distribution, download it from the Store once again. When you reinstall, you’ll get a fresh copy of the Linux environment.
You can also run the ubuntu clean
command in a Command Prompt or PowerShell window to delete your Ubuntu Linux file system. The next time you launch Ubuntu, it will set up a new file system without you having to redownload the software.
RELATED:How to Install and Use the Linux Bash Shell on Windows 10
All of the below commands can either be run in a Command Prompt window or a PowerShell window.
Right-click the Start button or press Windows+X on your keyboard and select “Command Prompt” to open a Command Prompt window. If you’d like to use PowerShell instead, you can launch PowerShell from the Start menu.
To remove the downloaded Bash environment, open a Command Prompt window and run the following command. This will uninstall and delete the Ubuntu user environment from your system, including any Linux applications you downloaded and installed with apt-get or by compiling them from source.
Windows will ask you to confirm your choice. To automatically accept the confirmation–ideal if you want to use this command in a script, for example–run the lxrun /uninstall /y
command instead.
This command won’t delete your home folder and the files in it. If you’d like to completely wipe the Linux system, see the next section.
The above command won’t delete your Ubuntu user account’s home folder. The home folder contains user preferences and files. If you install a new Ubuntu user space image, the files in your home folder will be preserved and carried over.
If you want to prevent this from happening, you’ll need to remove the downloaded Bash environment and completely wipe your home folder. To do so, run the following command:
You’ll be asked to confirm your choice. To automatically accept the confirmation, run the lxrun /uninstall /y /full
command instead.
To reinstall the Bash environment, you can just run the bash
command again, as you did when installing Bash the first time. If a Ubuntu user space image isn’t installed, it will automatically download and install it.
You can also run the following command yourself. This is the same command that bash.exe automatically runs if you launch it without a Ubuntu user space image installed.
Whether you run bash
or lxrun /install
, the command will ask you to confirm your choice and enter a username and password for the user account in the Bash environment.
To skip this process, you can run the following command instead. This command will automatically agree to the prompts, setting the “root” account as the default user account without a password. This is helpful if you want to automate the process of installing Bash in a script.
If you’d like to remove the bash.exe tool and the Windows Subsystem for Linux from your computer completely, you’ll need to revisit the “Turn Windows Features On or Off” dialog in the Control Panel.
To find it, open the Control Panel and head to Programs > Turn Windows Features On or Off.
Uncheck the “Windows Subsystem for Linux” option here and click OK. Windows will uninstall the Windows Subsystem for Linux, bash.exe, and lxrun.exe commands. You can always revisit the Windows Features dialog to reinstall them in the future.
READ NEXTDownload DBAN (http://www.dban.org/) and burn it to a blank CD/DVD using ImgBurn (http://www.imgburn.com/) (on XP/Vista) no additional Software needed for Windows 7 or alternatively make a bootable USB using Universal USB Installer (http://www.pendrivelinux.com/universal-usb-installer-easy-as-1-2-3/)
Insert this device and enter the BIOs setup (F2 at the Dell Bios Screen, different key for non-Dells), in the BIOs setup disable any card readers otherwise DBAN won't quite work. Boot from this device (Hold F12 for a Dell another key for a non-Dell at the BIOs screen and select boot from CD/DVD or from USB respectively). Follow the onscreen instructions to completely eradicate any data on your hard drive. Do this before installing Windows. Once this is complete reboot as prompted and then power down. When powering up hold F2 to enter the BIOs setup and then enable the card reader.
This will have wiped your hard drives properly.
Next install UBUNTU or similar do this by downloading their latest .iso and making a bootable USB or DVD and booting from it (F12 at the Dell BIOs screen or similar for a non-Dell) - follow the onscreen instructions and see how you like it. http://www.ubuntu.com/
Alternatively reinstall Windows 7, with the latest Service Packs, Microsoft Security Essentials & Microsoft Security Essentials latest definitions, a decent free Firewall such as Sphinx Windows 7 Firewall Control and also put Malwarebytes' Antimalware. A Dell-based guide including download links may be found here: http://en.community.dell.com/support-forums/software-os/w/microsoft_os/1434.aspx